我有两个Django项目,我为它们创建了两个不同的virtualenv。
当我创建另一个virtualenv并安装Django并创建Django项目时,我尝试了python manage.py
runserver,但出现以下错误:
Traceback (most recent call last):
File "manage.py", line 8, in <module>
from django.core.management import execute_from_command_line
ImportError: No module named 'django'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "manage.py", line 14, in <module>
import django
ImportError: No module named 'django'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "manage.py", line 17, in <module>
"Couldn't import Django. Are you sure it's installed and "
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?
我需要做什么? 我已经尝试卸载Django、pip、virtualenv并重新安装:
^{pr2}$
将
sudo
与virtualenvs一起使用会导致很多范围问题,而virtualenvs的virtual是您不需要对它们使用根权限(在大多数情况下)。在另外,如果您也为python2安装了virtaulenv,那么它可能是默认的。在
相关问题 更多 >
编程相关推荐