1

I am trying to install Django 2.0 on my Macbook on Sierra 10.12.6, with Python 2.7.14 using virtualenv but I keep getting this error code at the bottom:

(sorry in advance, I'm new here so not sure how to make it more user-friendly to read so also attached a screenshot below)

Joeys-MBP:somename joeybaloney$ 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 "<string>", line 1, in <module>
      File "/private/var/folders/wj/jbbqxb5d6ld9q00gw73mjzp00000gn/T/pip-build-QicGdd/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 61, 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/var/folders/wj/jbbqxb5d6ld9q00gw73mjzp00000gn/T/pip-build-QicGdd/django/

I've tried almost every solution here on Stackoverflow such as updating tools, using sudo pip install but nothing seems to work.

Terminal screenshot: enter image description here

1 Answer 1

6

Django 2.0 dropped support for python 2.

Django 2.0 supports Python 3.4, 3.5, and 3.6. We highly recommend and only officially support the latest release of each series.

so you can use 1.11 the LTS django version and it will work just fine,It will be long supported till at least April 2020. Django Roadmap

pip install django==1.11.8

The Django 1.11.x series is the last to support Python 2.7.

or install python3 and use pip3 or virtualenv with python3 then install django 2.0

Both of the quotes are from Django Docs

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.