I install django through :
git clone git://github.com/django/django.git
pip install -e django/
I use Ubuntu 16.04.
But some errors occur :
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/
How to fix this ? Thank you.
Python compatibility Django 3.0 supports Python 3.6, 3.7, 3.8, and 3.9 (as of 3.0. 11). We highly recommend and only officially support the latest release of each series.
Django can be installed easily using pip . In the command prompt, execute the following command: pip install django . This will download and install Django. After the installation has completed, you can verify your Django installation by executing django-admin --version in the command prompt.
Basically Yes, you'll need to install django for each project when you are using virtual environment.
The last Django version does not support python 2.7.
If you really want to use python 2.7 and also use Django you should install a previous Django version.
The latest supported is: 1.11
Therefore, just run:
pip install django==1.11
This because django version you have needs python3
interpreter. so try to run the same command using pip3
To install pip3
sudo apt-get -y install python3-pip
then run
pip3 install -e django/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With