I'm using ubuntu and I got python 2.7
and python 3.4.3
installed on my OS.
I'm trying to upgrade to Django 2
. ButI get this error while trying to install it using pip install -U Django
or pip install Django --upgrade
:
Traceback (most recent call last): File "", line 17, in File "/tmp/pip_build_alex/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' Complete output from command python setup.py egg_info: Traceback (most recent call last):
File "", line 17, in
File "/tmp/pip_build_alex/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'
I've read this question and another one, only to see that answers are offering OP to install a lower version of django!, but that's not a real answer to such question.
I tried alias python=python3
to set python 3 as default python but failed to get a working solution.
How can I install Django 2 in a OS with 2 versions of python without getting this error?