我安裝Django通過:當我通過git安裝django時出現錯誤?
混帳混帳克隆://github.com/django/django.git
PIP安裝-e的Django/
我使用Ubuntu 16.04。
但出現一些錯誤:
Obtaining file:///home/leo/django
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/leo/django/setup.py", line 32, in <module>
version = __import__('django').get_version()
File "django/__init__.py", line 1, in <module>
from django.utils.version import get_version
File "django/utils/version.py", line 60, in <module>
@functools.lru_cache()
AttributeError: 'module' object has no attribute 'lru_cache'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /home/leo/django/
如何解決這一問題? 謝謝。
你爲什麼從混帳安裝它,而不是用'PIP安裝django'?似乎你正試圖在Python 2上安裝它,而Django的最新開發版本需要Python 3. – kichik
是的,「pip install django」可以解決我的問題。但我只是不知道爲什麼會發生這個問題? – yensheng
因爲你試圖在Python 2上安裝它,但最新版本的Django需要Python 3. – kichik