教程---venv-lib---包括---垃圾箱---第一---管理员.py
我的问题是,试图在pychrem中打开,当我试图运行manage.py时,我遇到了这个错误。在终端evreything工作,但在pychrem不是。
/usr/local/bin/python3.8 /Users/alekseyzgeria/Desktop/tutorial/manage.py
Traceback (most recent call last):
File "/Users/alekseyzgeria/Desktop/tutorial/manage.py", line 11, in main
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:**
File "/Users/alekseyzgeria/Desktop/tutorial/manage.py", line 22, in <module>
main()
File "/Users/alekseyzgeria/Desktop/tutorial/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?
只需转到命令行并键入以下内容:
pip install django
您可能一直在虚拟环境中运行Django项目,您可以通过运行"pip-install Django";在您的终端中,继续您的工作。但是,您也可以找到以前的虚拟环境,并通过导航到venv目录(在Windows上,它应该是您的用户文件夹(并运行激活脚本来激活它,然后从那里开始工作。(如果Django没有安装在那个环境中,请运行前面的pip命令(