0

I am building new Django app with a new version of Django. I found Django 2.0 is available (2.0.5) https://www.djangoproject.com/download/, and now trying to install it with pip.

pip install Django==2.0.5

But it's not working for me.

Collecting Django==2.0.5
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x044F7630>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/django/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x044F7850>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/django/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x044F7A50>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/django/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x044F74D0>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/django/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x044F7C30>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/django/
  Could not find a version that satisfies the requirement Django==2.0.5 (from versions: )
No matching distribution found for Django==2.0.5

I am using python 3.6.5 and pip 9.0.3. What's wrong here?

Rajesh Pandya
  • 1,540
  • 4
  • 18
  • 31
Jayalakshmi
  • 53
  • 3
  • 8
  • 2
    Given that [The Django 1.11.x series is the last to support Python 2.7](https://docs.djangoproject.com/en/2.0/releases/2.0/), did you try to make things more explict, doing `pip3.6 install django==2.0.5`? Do you have multiple versions of python installed? If not, it looks like that you are behind a proxy. – keepAlive May 09 '18 at 09:52
  • You've written `pip install Django==2.0.5` you may try using `pip3`or `pip3.6` like suggested by @Kanak – MBT May 09 '18 at 09:55
  • `ConnectTimeoutError(, 'Connection to pypi.python.org timed out. (connect timeout=15)')` looks like you can't connect to `pypi` can you install direct from https://github.com/django/django/releases/tag/2.0.5 ? – shuttle87 May 09 '18 at 09:56
  • Does this happen for any other package also? – Anupam May 09 '18 at 10:33
  • Possible duplicate of [pip install fails for every package ("Could not find a version that satisfies the requirement")](https://stackoverflow.com/questions/49748063/pip-install-fails-for-every-package-could-not-find-a-version-that-satisfies-th) – phd May 09 '18 at 16:51
  • You need to use `pip3`. And when you type your commands in the terminal later, be sure to use `python3`. If me a while to figure that out. Most tutorials and examples don’t show that. – Carl Brubaker May 10 '18 at 01:38

3 Answers3

1

Upgrading pip manually did the trick for me

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py

In a virtual environment by the way.

Luc
  • 393
  • 7
  • 19
0

You can use

pip install Django==1.11

this is the one for Mac os running 10x

Max
  • 1
0

Install with pip specific version as pointed out by Kanak.

If you still get an error, that may be because of missing packages. I was also getting the same error. Finally resolved with the below set of commands:

sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev

Rerun python installation in the corresponding directory:

sudo make
sudo make install

Install django:

sudo pip3 install django

If you still get an error, install django using tar file:

Download Django-x.x.x.tar.gz from django website
Cd path/where/downloaded
tar -xzvf django.tar.gz (unzip the downloaded file)
cd Django-x.x.x

To install Django, use the command:

python setup.py install –user

Command for checking version:

django-admin –version

I hope that helps.