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

Time:01-25

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?

CodePudding user response:

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

CodePudding user response:

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

  •  Tags:  
  • Related