Reputation: 57
I just started to try and install/run Django on my cmd prompt and faced this issue although environment variables are set up for Django.
Besides getting a solution, can someone help me understand the root cause of the error below?
C:\Python>django-admin startproject test
Traceback (most recent call last):
File "C:\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\windows\syswow64\scripts\django-admin.exe\__main__.py", line 5, in <module>
ModuleNotFoundError: No module named 'django'
Upvotes: 2
Views: 4462
Reputation: 2782
On windows, go where you want to create your project, and call from there the django-admin.exe:
path\to\django-admin.exe startproject project_name
Its not a clean solution but worked for me.
Upvotes: -1
Reputation: 457
In python based project it is always good to create Virtual Environment and then run your django program .
pip install virtualenvwrapper-win
mkvirtualenv test
workon test
this will activate your virtual environment
Now install django
pip install django
After django installation complets
run
django-admin --version
Hope this helps.
Upvotes: 2