我是python的新手,当我运行这个命令时,我得到了这个错误
plutus@plutus-probook /var/www/html/python_learn/myproject $ python manage.py startapp webapp
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,则结果如下
plutus@plutus-probook /var/www/html/python_learn/myproject $ pip install django
Requirement already satisfied: django in /usr/local/lib/python2.7/dist-packages (1.11.6)
Requirement already satisfied: pytz in /usr/local/lib/python2.7/dist-packages (from django) (2017.2)https://stackoverflow.com/questions/51237380
复制相似问题