B
B
balberbro2020-02-29 12:06:03
Django
balberbro, 2020-02-29 12:06:03

Why doesn't the environment see Django?

Centos7
___

Installed python36 (sudo yum install python36-devel)
Created a virtual environment and failed into it by activating (source myprojectenv/bin/activate)
Installed Django (sudo pip3 install Django==2.2.10), just pip does not give, as it writes that there is no version I need.
I created the project via (django-admin.py startproject myproject .)
__

I try to roll the migration:

./manage.py makemigrations I get the

error:

Traceback (most recent call last):
File "./manage.py", line 10, in main
from django.core.management import execute_from_command_line
ModuleNotFoundError: No module named 'django'

__

If I do which django I get -

/usr/bin/which: no django in (/home/avi/nino/djangoen/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/avi /.local/bin:/home/avi/bin)

If I do sudo pip3 install Django==2.2.10 again, I get

Requirement already satisfied: Django==2.2.10 in /usr/local/lib/python3.6/site -packages

It seems that I added the path before /usr/local/lib/python3.6/site-packages to the global path, but it didn't help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rostislav Grigoriev, 2020-02-29
@crazyzubr

> Created a virtual environment and failed into it by activating (source myprojectenv/bin/activate)
>> Installed Django (sudo pip3 install Django==2.2.10)
Applying sudo to pip3 install will not install the package into the virtual environment, but globally into the system.
You should install the package without sudo and it should run.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question