I have both python 2.7 and python 3.5 installed on my Ubuntu 16.04 LTS. I have also installed python3-pip to be used for installing external packages to python 3.5.
Using pip3 I have installed django using the following command:
sudo pip3 install django
This command installed the package into the dist-packages directory ar /usr/local/lib/python3.5 on my computer.
I have used similar commands for installing other packages as well.
However when I ran this command after to start a django server :
python3 manage.py runserver
It show this error:
Traceback (most recent call last): File "manage.py", line 8, in <module> from django.core.management import execute_from_command_line ImportError: No module named 'django'
Also when I start python3 onterminal and type:
It too gives an error:
Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named 'django'
I face similar problems with other python packages I have installed using pip3 like BeautifulSoup, xlrd, xlwt, youtube-dl. I can access none of them from python3.
I should also mention that I use Pycharm for Python development. In that, I can access all of these packages and it uses python3.5 as intepreter which is located at /usr/bin/.
My question is how do I solve?
I have tried using simply
pip3 install django
but that gives the following error:
PermissionError: [Errno 13] Permission denied: '/home/rishav/.local/lib/python3.5/site-packages/django'
I have googled this problem and I have not found any viable solution. Please help me resolve this problem.