2

I am trying to install pygame with pip install . but every time i tried i faced to this error.

Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError(': Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it',))': /simple/pygame-1-9-3-cp36-cp36m-win-amd64/ Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError(': Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it',))': /simple/pygame-1-9-3-cp36-cp36m-win-amd64/ Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError(': Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it',))': /simple/pygame-1-9-3-cp36-cp36m-win-amd64/ Operation cancelled by user*

I have done it with other libraries but I faced the same problem

Ehsan.sarshar
  • 119
  • 1
  • 1
  • 6

4 Answers4

3

I had the same issue in windows. My antivirus was blocking PIP requests. Try disabling your antivirus(in my case manually killed it from task manager).

Sudeep
  • 129
  • 1
  • 4
2

Go to this Website, download the pygame‑1.9.3‑cp36‑cp36m‑win_amd64.whl file, open cmd, change directory to the folder you have the .whl file end type:

pip install pygame‑1.9.3‑cp36‑cp36m‑win_amd64.whl .

This works when you are trying to install packages and firewalls are blocking the connection.

Diego
  • 1,232
  • 17
  • 20
  • Requirement 'pygame-1.9.3-cp36-cp36m-win_amd64.whl' looks like a filename, but the file does not exist pygame-1.9.3-cp36-cp36m-win_amd64.whl is not a supported wheel on this platform – Ehsan.sarshar Nov 26 '17 at 08:04
  • I have a windows 10 64 bit and my python version is 3.6.3 – Ehsan.sarshar Nov 26 '17 at 08:31
  • Do you have (or had) any other python version installed on tour machine? Maybe the pip in the path is not python 3.6s. You May try using the full path of pip, something like: `C:\Python36\Scripts\pip install pygame-1.9.3-cp36-cp36m-win_amd64.whl` – Diego Nov 26 '17 at 12:10
  • You have the correct file. Your errror means that the cmd is not in the same folder as the .whl. Try this: Go to the folder where the .whl is, and with the SHIFT key pressed right click on the folder, choose "open command window here" and then: `pip install pygame‑1.9.3‑cp36‑cp36m‑win_amd64.whl` – Diego Nov 27 '17 at 18:58
1

I had same error message when I tried to install Python packages on my laptop with Windows 10 OS. I tried all methods recommended online and it still didn't work. I have been noticing for a while that Windows 10 automatically set proxy off causing Internet access problem sometime.

Then I googled with keywords: 'windows 10 automatic proxy setting off'. Someone mentioned to modify regedit key value of [ProxyEnabled=1] under Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings

I opened the regedit and found it's [ProxyEnabled=1]. I compared HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings with another workstation with relatively clean image. It's [ProxyEnabled=0] and no other extra entry for Proxy.

Solution: set ProxyEnabled=0 and delete any other Proxy entries. It worked successfully! pip install package_name

Mindy
  • 11
  • 1
0

It looks like pip is not connecting to the internet. I have a few options -- I don't know if they will work, but you can try them.

  1. Try to reinstall pip (pip3 if using python3) I had to do this on my systeme, as pip3 didn't work initally either.
  2. Check and see if you can ping a website from your terminal to check connectivity. You could have an error with your terminal (if using linux) and not with python itself.

Good luck, and hope this helps!

user43850
  • 28
  • 1
  • I think I have pip3 and there is not any problem with my connection I have tried ping – Ehsan.sarshar Nov 23 '17 at 16:47
  • Specifically, you should type `pip install -h`, and look under `--index-url` to see what your default python package index url is. (It's usually `pypi.org/simple`.) Then ping this url (e.g. `ping pypi.org`) – cowlinator Sep 30 '19 at 10:46