source ./bin/activate
後,做一個which python3.5
我得到如下回應如何用Python 3.5運行Django?
/path/to/virtualenv/bin/python3.5
我這根據自己的documentation支持Python 3.5
使用Django 1.10.5
。但在做python3.5 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?
我的項目工作完全正常,在我的Ubuntu 14.04系統默認python 3 (3.4)
。這裏有什麼問題?
如果有任何幫助,我跟着this過程安裝python 3.5
。我沒有從答案中給出的機器中刪除現有的python3
。我有python3
和python3.5
你是如何爲python 3.4安裝Django的? – flowfree
'pip安裝django'內virtualenv – Kos
我做了pip安裝django在virtualenv裏面。請注意,這是一個現有的django項目,我正在從python 3.4升級到python 3.5 –