i'm trying to run some machine learning environment on Kaggle, but i can't install the packages... I Need to install stable-baselines3[extra] but i cant. I tried with
pip install stable-baselines3[extra]
but i get this error:
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None))
after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection
object at 0x7f8159233e50>: Failed to establish a new connection: [Errno -3] Temporary failure
in name resolution')': /simple/stable-baselines3/
How to resolve this?
Related
I want to install flask-sqlalchemy within the virtual environment on my ubuntu subsystem (WSL) on Windows 11, using the following command:
pip install flask-sqlalchemy
however i recieve an error in console window.
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7ff5c27dff10>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/flask-sqlalchemy/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7ff5c2620280>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/flask-sqlalchemy/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7ff5c2620520>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/flask-sqlalchemy/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7ff5c26206d0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/flask-sqlalchemy/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7ff5c2620880>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/flask-sqlalchemy/
ERROR: Could not find a version that satisfies the requirement flask-sqlalchemy (from versions: none)
ERROR: No matching distribution found for flask-sqlalchemy
I think it is related with network connection in my Ubuntu subsystem. I try on Standalone Linux system and it seems to be work. How i can solve this issue?
i finnaly resolve my issue. I post below steps to solve this problem.
I checked my fireewall settings. It was not an issue.
i dont use proxy so i skipped the proxy issue.
i checked ping from the console window
ping google.com
it displayed
ping: google.com: Temporary failure in name resolution
I found a solution. Seems like my DNS server can't find an address associated to the URL i am passing. I got errors because the resolv.conf file was not set up in my Ubuntu Subsystem.
solution:
in wsl Ubuntu Linux type commamnd
sudo nano /etc/resolv.conf
add nameserver and save file
nameserver 8.8.8.8
strong textI manually install package as follows:
pip install C:\Users\AAA PC\Desktop\selenium.whl
I get the following error:
Collecting requests
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0424C6F0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/requests/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0426E150>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/requests/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0426E230>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/requests/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0426E310>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/requests/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0426E3F0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/requests/
Could not find a version that satisfies the requirement requests (from versions: )
No matching distribution found for requests
First upgrade:
python -m pip install --upgrade pip
Then, enter in the terminal:
pip install -U selenium
pip install "C:\Users\AAA PC\Desktop\selenium.whl"
This should install from any directory.
An important thing worthy of noting is the .whl file name should not be renamed from the original. For example, if you want to install .whl for the selenium module, I believe the original name of the file is "selenium-3.141.0-py2.py3-none-any.whl" (as per PyPI)
Hence you need to rename the file to the original name and install using
pip install "C:\Users\AAA PC\Desktop\selenium-3.141.0-py2.py3-none-any.whl"
else you could see errors like "ERROR: selenium.whl is not a valid wheel filename"
Also, your error says, collecting requests.
This tells the python is having issues downloading the requests module, not with the selenium module. Hence you could first install requests.whl and then try installing selenium
First make sure pip is up to date using this command:
python -m pip install --upgrade pip
Then run to install the wheel file, run this command:
pip install "C:/Users/AAA PC/Desktop/selenium.whl"
However, this is not the original name of the wheel file. The official wheel name, from PyPi is:
selenium-3.141.0-py2.py3-none-any.whl
So you should delete that file and reinstall it from PyPi. You'll end up with this command:
pip install "C:/Users/AAA PC/Desktop/selenium-3.141.0-py2.py3-none-any.whl"
How about instead of using Pip, use setup.py. If you download the selenium tarball you can run python setup.py install from within the uncompressed directory of the tar file.
I tried to download the pip install PyMySQL on my Anaconda prompt (Im using Spyder as IDE). Its not working. I received this error. Someone who knows how to fix it? Iam using Python version 3.7.4 64-bit. Thank you in advance :)
(base) C:\Users\AK>pip install PyMySQL
Collecting PyMySQL
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001E5EC2F84C8>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')': /simple/pymysql/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001E5EC30CC48>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')': /simple/pymysql/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001E5EC319408>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')': /simple/pymysql/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001E5EC319908>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')': /simple/pymysql/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001E5EC319B88>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')': /simple/pymysql/
ERROR: Could not find a version that satisfies the requirement PyMySQL (from versions: none)
ERROR: No matching distribution found for PyMySQL
This could be due to an antivirus or some other program on your computer interfering with network connections (see pip install is not working).
I am able to install PyMySQL with the following:
pip install PyMySQL
There are a few possible solutions.
Install with conda: conda install pymysql
Download the wheel for PyMySQL and install it using that file.
Go to https://pypi.org/project/PyMySQL/#files and download the .whl file.
Run pip install path/to/PyMySQL-0.9.3-py2.py3-none-any.whl
If antivirus is in fact playing a role, then I'm not sure what to do, but google is your friend.
My Docker file is
FROM python:3
ADD myapp.py /
RUN pip3 install tensorflow-gpu
RUN pip3 install numpy
RUN pip3 install pandas
CMD ["python3", "./myapp.py]
When I build the docker image using
docker build -t gaurav .
I get the following errors
Step 4/5 : RUN pip3 install tensorflow-gpu
---> Running in 8f938c75e2e0
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fae543d7cd0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/tensorflow-gpu/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fae543d79d0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/tensorflow-gpu/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fae543d7220>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/tensorflow-gpu/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fae543d7640>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/tensorflow-gpu/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fae543d7790>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/tensorflow-gpu/
ERROR: Could not find a version that satisfies the requirement tensorflow-gpu (from versions: none)
ERROR: No matching distribution found for tensorflow-gpu
The command '/bin/sh -c pip3 install tensorflow-gpu' returned a non-zero code: 1
Can you help me here, I want to install all these packages, but I can't get past these errors.
https://github.com/tensorflow/tensorflow/issues/33374 - tensorflow is not available for python3.8 so you have to use python image with version 3.7 or lower:
FROM python:3.7
As stated here Tensorflow - requirements.
Tensorflow is supported only Python 3.5–3.7
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