我在目录中有一些django项目,它们在runserver中运行良好。这些项目非常相似,因此我创建了一个子目录,并将django项目移到了该子目录中。现在,当我尝试运行服务器时,出现以下错误。 virtualenv已激活,并且pip表示django已安装,但由于某种原因它无法导入django。为什么我现在会收到此错误?
jpanknin:spinup2/ (master) $ source virtualenv/bin/activate [22:56:28]
(virtualenv) jpanknin:spinup2/ (master) $ pip install "django<1.12" [22:56:37]
Requirement already satisfied: django<1.12 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (1.11.22)
Requirement already satisfied: pytz in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from django<1.12) (2018.5)
(virtualenv) jpanknin:spinup2/ (master) $ python manage.py runserver [22:56:53]
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?