C:\Python>python get-pip.py
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000002EDF31D2AD0>, 'Connection to 10.1.1.9 timed out. (connect timeout=15)')': /simple/pip/
Screenshot of the error message
I'm trying to install pip on my windows 11. I have navigated to the directory in which Python is installed. And yet, I am constantly getting the same error again and again. I haven't configured anything yet. Please guide me through the complete procedure right from the beginning by installing python.
Related
I'm trying to get Python's IBM DB2 package 'ibm-db' up and running, but my efforts keep failing so far. The problem is that I'm behind a corporate proxy which apparently prevents downloads of dependencies needed for package installation. The command I used is:
pip --trusted-host pypi.org --trusted-host files.pythonhosted.org install --proxy=http://<host>:<port> ibm-db
This successfully downloads the package and then tries to install some build dependencies:
Installing build dependencies ... error
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> [9 lines of output]
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000001B0F00AEE60>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/setuptools/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000001B0F00AE200>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/setuptools/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000001B0F00ACEB0>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/setuptools/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000001B0F128C070>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/setuptools/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000001B0F128E9B0>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/setuptools/
AFAIK, the only dependency is DB2 ODBC CLI driver. ibm-db's installation instruction says you could skip that depenedency by installing ODBC CLI manually and then setting IBM_DB_HOME env variable to its installation directory - which I did, but without success. Pip still tries to download and install the dependency. I also used the --no-deps flag to keep pip from downloading it, but again without success.
So, is there another way to forcefully prevent dependency installation or make build dependencies work behind a proxy?
Btw: I'm using Python 3.10.5 and pip 22.0.4
EDIT: The OS is Win 10, so the CLI driver has been set using control panel. Installation is local.
I'm trying to install the "pymoo" package in order to work on multi-objective optimization and when trying to install with the pip command: pip install pymoo I'm getting the retrying warnings:
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/pymoo/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/pymoo/
And so on.. until the count runs out and I get the following error messages:
ERROR: Could not find a version that satisfies the requirement pymoo
ERROR: No matching distribution found for pymoo
I've tried installing by getting the code from GitHub and installing with pip install . , but it gives me the same error messages.
Is there anything I'm missing in the installation process?
If I try to download Python packages with pip, following error messages come out.
nblizz#NBLIZZ-PC:~# pip3 install flask-restful
Collecting flask-restful
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', OSError(0, 'Error'))': /simple/flask-restful/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', OSError(0, 'Error'))': /simple/flask-restful/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', OSError(0, 'Error'))': /simple/flask-restful/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', OSError(0, 'Error'))': /simple/flask-restful/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', OSError(0, 'Error'))': /simple/flask-restful/
Could not find a version that satisfies the requirement flask-restful (from versions: )
No matching distribution found for flask-restful
None of these solutions work.
Re-install pip
Re-install WSL
sudo pip3 install [package]
pip3 install [package] with root account
sudo -H pip3 install [package]
pip install --user [package]
How do I install pip packages without errors?
Update your pip: python -m pip install –upgrade pip; If its already updated proceed with any of the below two methods:
Method - I
You can download binary files from the below link
https://www.lfd.uci.edu/~gohlke/pythonlibs/
Once the desired module (.whl file) is downloaded, open the command prompt on the downloaded location (you can do that by pressing shift + right click; select open command prompt/powershell here) and type pip install your-package.whl
Method - II
Go to https://pypi.org/ and search for the desired package.
Once downloaded, copy the package in the site-packages directory manually.
There are standard locations for site-package:
Unix(pure): prefix/lib/pythonX.Y/site-packages
Unix(non-pure):exec-prefix/lib/pythonX.Y/site-packages
Windows:prefix\Lib\site-packages
To verify the download, by either of these methods, use the import statement on your console.
I use google to search: pip ProtocolError
Someone said that:
SOLVED The issue was that my dorm firewall is blocking pip (pypi.python.org). Issuing the same command at work installs python packages correctly.
see: PIP not working - proxy - Connection aborted
If this solution still not work for you, please tell more about your machine like
pip --version, pip3 --version, python3 -V, python -V, cat /etc/issue
The cause was my Kaspersky application. It blocks every pip/curl executions.
I had a similar but not identical problem with pip in WSL. (There is a diffrent error message).
$ pip3 install pytest
Collecting pytest
Cache entry deserialization failed, entry ignored
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f3b23344eb8>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/pytest/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f3b23a7e748>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/pytest/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f3b23a7e940>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/pytest/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f3b23a7e390>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/pytest/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f3b23a7eb00>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/pytest/
Could not find a version that satisfies the requirement pytest (from versions: )
No matching distribution found for pytest
It turned out the WSL could't connect to any DNS server. ping 8.8.8.8 -c 1 was successful, but ping www.google.com -c 1 resulted in Temporary failure in name resolution. The reason for this was that /etc/resolv.conf was corrupted. I fixed it by replacing the corrupted content with the content below:
# This file was automatically generated by WSL. To stop automatic generation of this file, remove this line.
8.8.8.8
4.4.4.4
(Use e.g. nano for editing: sudo nano /etc/resolv.conf). I used Google's DNS servers above. WSL should update the DNS server automatically if the first line is included. After this pip worked normally again for me.
I faced the same issue on WSL1 using conda environments. Eventually I found out that the solution is to have the same python version in conda's base environment as in the conda environment from which the pip install commands are being triggered.
sudo pip install should be avoided (even if as it seemingly solves the NewConnectionError error), as it will install packages globally and will mess up conda environments.
Two issue that typcially get overlooked for me.
Add public dns entry to /etc/resolv.conf
nameserver 8.8.8.8
This will be overwritten on next startup unless you create a /etc/wsl.conf file with the below
[network]
generateResolvConf = false
The first issue is typically only a problem if wsl and windows have a time drift.
From Powershell...
Get-Date; wsl date
If your output doesn't match give it good old reboot. Usually fixes the issue for me.
Tried all solutions, what solved the issue for me is to update the wsl by running from Windows CMD
wsl --update
I'm trying to install a library in anaconda but i have the next error (with any library I tried:
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x00000000051CECC0>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/worldcloud/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x00000000051CEDA0>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/worldcloud/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x00000000051CEA90>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/worldcloud/
I want to know if exists a solution for this problem, or in other case, if I could download and charge the packages with other way.
I'm using Windows 10 and python 2.7
Welcome to Stackoverflow.
Is it possible you have an old version of pip that doesn't know to use TLS (https) communications? Find out which version you are using with
pip --version
You need to be using pip 9.0.3 or higher. If you aren't, you might solve the issue with
conda update pip
Alternatively, perhaps you have set up a proxy that pip can't use or isn't using.
In the command line of your PC, type ping pypi.org and see what happens. If there is no response, you have an external network issue. If there is one, try giving pip elevated permissions just this one time to see if it works.
Running the following command:
pip install matplotlib --disable-pip-version-check
Gives the following output:
Collecting matplotlib
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip
._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x02D9D0F0>, 'Connection to pypi.python.
org timed out. (connect timeout=15)')': /simple/matplotlib/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip
._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x02D9DE70>, 'Connection to pypi.python.
org timed out. (connect timeout=15)')': /simple/matplotlib/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip
._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x02D9D890>, 'Connection to pypi.python.
org timed out. (connect timeout=15)')': /simple/matplotlib/
Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip
._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x02D9D8D0>, 'Connection to pypi.python.
org timed out. (connect timeout=15)')': /simple/matplotlib/
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip
._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x02D9DD90>, 'Connection to pypi.python.
org timed out. (connect timeout=15)')': /simple/matplotlib/
Could not find a version that satisfies the requirement matplotlib (from versions: )
No matching distribution found for matplotlib
Check your Internet connection.
It seems that the Internet is unreachable for you. Less likely, PyPi is experiencing temporary problems and you should try connecting later.
Very simple methods step by step:-
Download matplotlib(.whl) from http://www.lfd.uci.edu/~gohlke/pythonlibs/
matplotlib also Requires numpy, dateutil, pytz, pyparsing, cycler, setuptools
process:
open>python27>>Scripts>copy and paste matplotlib.whlfile
open cmd on python27>Scripts>pip install matplotlib-1.5.1-cp27-none win_amd64.whl
I think this is the simplest install method.
Just try it if you face again same problem then ping me.
Another possible solution - I found an executable installer here
Didn't find it with Google before.
Try ignoring the cache:
pip install matplotlib --no-cache
No idea how this works, because when it said ConnectionTimeoutError, I assumed that it was not using the cache. If this works for anyone, I'd love to hear an explanation.