[Django]-PIP cannot install Django inside VIrtualenv

11πŸ‘

βœ…

As an alternative to wim’s answer, if you can’t upgrade your Python version for whatever reason, you can install Django 1.11 which is still compatible with Python 2.7:

pip install 'django<2.0'

3πŸ‘

Make sure your Python version in the virtualenv is Python 3.4+.

Django 2.0 only supports Python 3.4+, and functools.lru_cache is only available in 3.2+.

To check the Python version in your current virtualenv:

python --version

To create a new virtualenv with python 3:

python3 -m venv venv --prompt=myenv
πŸ‘€wim

0πŸ‘

This error is because of wrong picking of pip and python version . You can solve it by adding below lines in the ~/.bash_profile

  alias python='python3'
  alias pip='pip3.6' 

After that close the terminal and run the following command to install Django

  pip install Django==2.0
πŸ‘€Uahmed

0πŸ‘

For latest version of Django, python 3 is required, thus try installing

pip install django==1.11
πŸ‘€Vidip

Leave a comment