应用程序部署:Django未在服务器上安装 - AttributeError:'module'对象没有属性'lru_cache'

Joe*_*sel 6 web-deployment

我正在尝试部署Django应用程序,出于某种原因,我不断收到此错误.在我看来,Django没有安装,但安装时也出错.感谢您的帮助.我正在Amazon EC2上部署


(venv) ubuntu@ip----:~/quotes$ pip install Django
Collecting Django
  Using cached Django-2.0.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "", line 1, in 
      File "/tmp/pip-build-ceP6se/Django/setup.py", line 32, in 
        version = __import__('django').get_version()
      File "django/__init__.py", line 1, in 
        from django.utils.version import get_version
      File "django/utils/version.py", line 61, in 
        @functools.lru_cache()
    AttributeError: 'module' object has no attribute 'lru_cache'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-ceP6se/Django/

小智 8

Django已经停止了对Python 2版本的支持,你仍然可以尝试使用下面的代码安装1.11版本.

pip install Django==1.11
Run Code Online (Sandbox Code Playgroud)