简体   繁体   中英

I tried to install django using pip install django but still i am getting this error any comments

from django.core.management import execute_from_command_line ModuleNotFoundError: No module named 'django'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "C:\Users\emin\Desktop\fliteplan\gen_angular\arinc_424_19_db\multi\src\manage.py", line 22, in main() File "C:\Users\emin\Desktop\fliteplan\gen_angular\arinc_424_19_db\multi\src\manage.py", line 13, in main raise ImportError( ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?

Make sure to have a virtual environment whenever saving new dependencies, most importantly django.

virtualenv env
source env/bin/activate

pip install django

// save the dependency
pip freeze > requirements.txt

* Note the syntax, virtualenv [env name] env can be any name but you would still activate it from [env name]/bin/activate

Did you active your virtual environment? If didn't then you can follow this solution to do that here is the link

And if still unable to install Django then check your python installation. if python is working perfectly then try

python -m pip install django

and according to your os, you can follow this official documentation link official documentation of Django to install

Thanks

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM