我有python版本2.7.3
,我想學習django,所以我在我的Ubuntu 12.0.4上安裝了django 1.8.2版本。我是否需要分別爲不同的python版本安裝django?
[email protected]:~/bin$ python
Python 2.7.3 (default, Sep 26 2013, 20:08:41)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>> django.VERSION
(1, 8, 2, 'final', 0)
然後我讀的是最好的辦法喲Django的工作是在Python版本工作3.3
,所以我在我的系統,其中PY是符號鏈接指向/opt/python3.3/bin上安裝Python版本3.3.6 /python3.3
[email protected]:~/bin$ py
Python 3.3.6 (default, Jun 21 2015, 16:13:35)
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
當我嘗試和進口的Django在這裏,我得到錯誤
>>> import django
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'django
我看到Django的安裝得到了我的Python 2.7目錄。
>>> import django
>>> django
<module 'django' from '/usr/local/lib/python2.7/dist-packages/django/__init__.pyc'>
我該如何使用這個django與我的3.3.6版本。我的默認python版本是2.7.3 這裏有什麼可能的鍛鍊?
謝謝你的回答。我能夠在此鏈接提供的布爾答案幫助下做到這一點http://askubuntu.com/questions/244544/how-do-i-install-python-3-3。但是你能否在這裏解釋更多有關requirements.txt的內容,我如何保持這個更新。 – Invictus
編輯回答你的問題^^ – spectras
非常感謝:) – Invictus