Befehl "python setup.py egg_info" schlug mit Fehlercode 1 in / private / tmp / pip-sTRicb-build / fehl.

2118
user698048

Ich versuche, Django zu installieren und erhalte die folgende Fehlermeldung. Bitte lassen Sie mich wissen, was das Problem zu sein scheint.

Vielen Dank,

(ENV) AP-MacBook-Pro:bin $ sudo -H pip install django/ Processing ./django Complete output from command python setup.py egg_info: Traceback (most recent call last): File "<string>", line 1, in <module> File "/private/tmp/pip-sTRicb-build/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 /private/tmp/pip-sTRicb-build/ 
2

1 Antwort auf die Frage

0
Egor Smolyakov

lru_cache ist nur in Python 3 verfügbar.

Hinweis : Die Frage zeigt, dass Python 2 im Installationsschritt verwendet wird. Diese Ausnahme "AttributeError: 'Modul' Objekt hat kein Attribut 'lru_cache'" zeigt es an. Sie müssen Python 3 mit Django 2.0 verwenden, da Django 2.0 nur Python 3 unterstützt.

Es scheint, als würde der Autor der Frage beim Installationsschritt Python 2 verwenden. Diese Ausnahme "AttributeError: 'Modul' Objekt hat kein Attribut 'lru_cache'" zeigt es an. Der Autor muss Python 3 mit Django 2.0 verwenden, da Django 2.0 nur Python 3 unterstützt. Egor Smolyakov vor 6 Jahren 0