[英]ModuleNotFoundError: No module named 'django' while running server in virtual environment
i am new in python learning.after learning python basics i have moved to learn python web framework Django. i am new in python learning.after learning python basics i have moved to learn python web framework Django. for this
为了这
i followed these steps for installing django on my windows after installing python 3.7在安装 python 3.7 后,我按照这些步骤在我的 windows 上安装 django
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'
回溯(最后一次调用):文件“manage.py”,第 10 行,主要来自 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 "manage.py", line 21, in main() File "manage.py", line 12, 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?
回溯(最近一次调用最后一次):文件“manage.py”,第 21 行,在 main() 文件“manage.py”,第 12 行,在 main 中引发 ImportError(ImportError: Couldn't import Django。你确定它已安装并在您的 PYTHONPATH 环境变量中可用?您是否忘记激活虚拟环境?
can anyone guide me what i have done here wrong?谁能指导我在这里做错了什么? why its showing error
为什么它显示错误
i got solution by myself.我自己得到了解决方案。 actually i had downloaded python twice with different versions also i had downloaded python with anaconda package.
实际上我已经下载了两次不同版本的 python 我也下载了 python 和 anaconda ZEFE90A8E604A7C840E88D03A67F。 i uninstalled all python versions and anaconda from my computer then i reinstalled python from his official website.
我从我的电脑上卸载了所有 python 版本和 anaconda 然后我从他的官方网站重新安装了 python。 then i tried above method which works fine.thanks to myself
然后我尝试了上面的方法,效果很好。感谢我自己
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.