Where does Pip3 install the modules?

  • Ubuntu 15.10
  • Python 3.4.3 +
  • Django 1.8.7

When I try import djangoin the python3 interpreter, it says ImportError: No module named 'django'. I know that Django 1.8.7 is installed because I can get version # by running django-admin --versionon the command line of the terminal.

When I tried python3 manage.py runserverin the Django project directory, I get 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'

So again (as expected), this is not in the way where Python can find it.

I looked in /usr/local/lib/python3.4/dist-packages, but this is an empty directory.

I did whereis djangoand whereis django, and it just gives me a line with django:or django:respectively and does not contain a list of paths.

I tried Googling how to find the path to Django , but nothing helped.

django-admin, , , Django. , python django, , Django django. python, ?!? , .

Ubuntu ( ). - , , Django? , , pip3. , .

+4
2

pip 3 python3 dist-packages

pip :

python3 -m pip install package

, python3

ls /usr/local/lib | grep python

-

+9

, django .  

pip install virtualenv
virtualenv your_env

.

source your_env/bin/activate

, django .

+2

Source: https://habr.com/ru/post/1617348/


All Articles