2

DISCLAIMER - I am new to the world of Django and Python. If the question sounds stupid, please bear with me.

OS - Windows 10

Python Version Installed - 3.7

In the windows command prompt, I am trying the following command to download django on my system.

pip install django

pip3 install django

Collecting django

Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError(': Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))': /simple/django/

Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError(': Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))': /simple/django/

Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError(': Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))': /simple/django/

Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError(': Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))': /simple/django/

Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError(': Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))': /simple/django/

Could not find a version that satisfies the requirement django (from versions: )

No matching distribution found for django

If anybody could help me out or show some direction that would be great. Thanks in advance.

DISCLAIMER 2 :- This is an office environment and not my personal system so there should be restrictions on the firewall and other such good stuffs.

KChow
  • 317
  • 3
  • 15
  • Try running your cmd or powershell as administrator and see if you can pip install that way. Also, did you make a virtual environment first, activate it, and then try your django install? – dfundako Jul 20 '18 at 15:24
  • Will do. Will respond if that works. – KChow Jul 20 '18 at 15:25
  • That did not work. Getting the same error. – KChow Jul 20 '18 at 15:31
  • As far as I know Django has no version 2.7 – Nipun Thennakoon Jul 20 '18 at 15:42
  • I meant to say 2.0.7. – KChow Jul 20 '18 at 15:48
  • Also since I am not providing any version number, it should ideally download the latest one.. Is there any configuration setting I must set for pip to work? – KChow Jul 20 '18 at 15:49
  • @dfundako I did not create a virtual environment, Since I will only have one django flavor and one django project, I do not need a virtual environment. Also, I have installed Django on my personal system using the same process and without creating virtual environment and it had worked then. – KChow Jul 20 '18 at 15:51
  • As you said, this may be the issue with the firewall or something like that. Contact your system admins – JPG Jul 20 '18 at 16:15

2 Answers2

1

You can try downloading Django unofficial binaries form https://www.lfd.uci.edu/~gohlke/pythonlibs/ (use ctrl + F to find the package)

and install using

pip install "path to downloaded wheel file"

Edit: Offline installation of Django worked with the OP as he did not like to install the unofficial binaries.

  1. Downloaded pytz from https://pypi.org/project/pytz/#files
  2. And then downloaded Django from https://pypi.org/project/Django/#files
  3. Installed wheel files of pytz first and Django next using pip.
Nipun Thennakoon
  • 3,586
  • 1
  • 18
  • 26
  • The list doesn't have Django. Also, I am not sure if my company would allow me to download anything that is not from an official source. – KChow Jul 20 '18 at 15:47
  • It does have Django-2.0.6(I checked). I'll try to find some another way then :) – Nipun Thennakoon Jul 20 '18 at 15:50
  • Could you try to manually download django using https://pypi.org/project/Django/#files and intall it using pip? – Nipun Thennakoon Jul 20 '18 at 15:52
  • Do I download the wheel or the source? Whats the difference? – KChow Jul 20 '18 at 15:53
  • download the wheel and install it using pip install "path to wheel" – Nipun Thennakoon Jul 20 '18 at 15:55
  • will try that and let you know. – KChow Jul 20 '18 at 15:56
  • for the difference between whl and targz check here https://stackoverflow.com/questions/31401762/python-packaging-wheels-vs-tarball-tar-gz – Nipun Thennakoon Jul 20 '18 at 15:56
  • Tried it. Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))': /simple/pytz/ Could not find a version that satisfies the requirement pytz (from Django==2.0.7) (from versions: ) No matching distribution found for pytz (from Django==2.0.7) – KChow Jul 20 '18 at 17:16
  • Could not find a version that satisfies the requirement pytz (from Django==2.0.7) (from versions: ) No matching distribution found for pytz (from Django==2.0.7) – KChow Jul 20 '18 at 17:18
  • Is there any readymade installer like a .exe file which I can use to download Django? – KChow Jul 20 '18 at 17:27
  • Not that I know of.It seems like there is a network problem. try downloading and installing the pytz https://pypi.org/project/pytz/#files and then installing django – Nipun Thennakoon Jul 20 '18 at 17:33
  • Why do I need pytz? What is it used for? – KChow Jul 20 '18 at 17:50
  • pytz is a requiremenet for django.It is used to simplify the timezone handling in django. – Nipun Thennakoon Jul 20 '18 at 17:54
  • Yaa.. Just read the description. Do I need to get anything else installed before trying to install Django? – KChow Jul 20 '18 at 17:54
  • don't think so. – Nipun Thennakoon Jul 20 '18 at 17:56
  • My pleasure :) I will edit the answer to depict the most recent method we tried. – Nipun Thennakoon Jul 20 '18 at 18:39
0

This is because your internet proxy is blocking it. So download the installable(.whl,tz) from the server and copy to your local and install it with

pip install <downloaded file name>
usernumber
  • 1,958
  • 1
  • 21
  • 58