I have a python project working in venv with python3.7.
When I create new venv with python 3.10 for this project pip can not install packages via proxy. However it work in old venv.
cli:
C:\WINDOWS\system32>C:\Users\user\PycharmProjects\PytestHabr\ch2\venv\Scripts\activate.bat
(venv) C:\WINDOWS\system32>pip install --proxy http://user:pass#bproxy:port pytest
Collecting pytest
Downloading pytest-7.2.0-py3-none-any.whl (316 kB)
|████████████████████████████████| 316 kB 939 kB/s
(venv)C:\WINDOWS\system32>C:\Users\user\PycharmProjects\PytestHabr\ch2\venv_py310\Scripts\activate.bat
(venv_py310) C:\WINDOWS\system32>pip install --proxy http://user:pass#bproxy:port pytest
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', FileNotFoundError(2, 'No such file or directory'))': /simple/pytest/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', FileNotFoundError(2, 'No such file or directory'))': /simple/pytest/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', FileNotFoundError(2, 'No such file or directory'))': /simple/pytest/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', FileNotFoundError(2, 'No such file or directory'))': /simple/pytest/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', FileNotFoundError(2, 'No such file or directory'))': /simple/pytest/
ERROR: Could not find a version that satisfies the requirement pytest (from versions: none)
ERROR: No matching distribution found for pytest
(venv_py310) C:\WINDOWS\system32>pip --version
pip 21.3.1 from
C:\Users\user\PycharmProjects\PytestHabr\ch2\venv_py310\lib\site-packages\pip (python 3.10)
I tried use PyCharm with proxy setting, but it works only with venv Python 3.7.
I am trying to install flask using python pip in my linux machine having rhel7
-> python3.7 --version
Python 3.7.2
-> pip3.7 --version
pip 18.1 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)
Problem :
-> pip3.7 install flask
Collecting flask
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fad3a9f60b8>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /simple/flask/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fad3a9f6128>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /simple/flask/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fad3a9f6390>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /simple/flask/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fad3a9f6358>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /simple/flask/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fad3a9f64e0>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /simple/flask/
Could not find a version that satisfies the requirement flask (from versions: )
No matching distribution found for flask
I tried to use below command as well but same error
python3.7 -m pip install flask
I suggest that you look at this Flask documentation page. As mention in the documentation, you need to activate the environment and then proceed to install by running the command pip install Flask.
This doc also refers to Python 2.7 as well. Keep that in mind when following this doc.
try this code:
pip3 install flask
Or:
pip install flask
Good luck.
I'm trying to get Python 3.6 with numpy and openCV setup on a windows 10 machine. I have python 3.6.8 installed with pip 18.1. When I try to install anything with pip, regardless of the package, I get the same result:
C:\WINDOWS\system32>pip install numpy
Collecting numpy
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001D135A3AE48>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)': /simple/numpy/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001D135A3ABE0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)': /simple/numpy/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001D135A3A8D0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)': /simple/numpy/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001D135A3A7B8>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)': /simple/numpy/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001D135A3A9B0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)': /simple/numpy/
Could not find a version that satisfies the requirement numpy (from versions: )
No matching distribution found for numpy
I've tried updating pip, and it tells me that it's already up-to-date. What's going on?
I figured it out. It was some proxy issue on my company's network. Using --proxy after pip install numpy worked.
Please try this code
python3 -m pip install <pkg>
Try this code. This sets pypi.org and files.pythonhosted.org as trusted hosts to ignore SSL errors.
pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org
Answer from this question: pip install fails with "connection error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598)"
I am using docker on window.
Below is my docker file:
FROM microsoft/windowsservercore:latest
FROM python:3.7
RUN pip install flask
CMD ["cmd"]
When I try to build docker image it throws the folowing exception:
>docker build D:\HCL\Docker\
Sending build context to Docker daemon 14.34kB
Step 1/4 : FROM microsoft/windowsservercore:latest
---> ea9f7aa13d03
Step 2/4 : FROM python:3.7
---> 2137b5b81384
Step 3/4 : RUN pip install flask
---> Running in 7463787fcfa8
Collecting flask
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/flask/
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/flask/
Retrying (Retry(total=2, 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/flask/
Retrying (Retry(total=1, 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/flask/
Retrying (Retry(total=0, 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/flask/
Could not find a version that satisfies the requirement flask (from versions: )
No matching distribution found for flask
The command 'powershell -Command $ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue'; pip install flask' returned a non-zero code: 1
I have checked docker has internet access but not able to download any package over https.
I have checked downloading files over http and it is working fine.
I am able to install windowcore and python in the same docker file.
I am only getting issue with pip.
I have logged into the container and run the pip command manualy but got the same error.
I have installed python over a custom location.
I am trying to install some packages however get the below error. I realized since I am on a VM and they are using proxy.
C:\python3.7>python -m pip install requests
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
So I change the command to use the proxy. It clearly shows a certificate error so I contacted IT support and they have their own issues which is only frustrating.
C:\python3.7>python -m pip install requests --proxy=http://proxypac.novartis.net:2010
Collecting requests
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1056)'))': /simple/requests/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1056)'))': /simple/requests/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1056)'))': /simple/requests/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1056)'))': /simple/requests/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1056)'))': /simple/requests/
Could not fetch URL https://pypi.org/simple/requests/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/requests/ (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1056)'))) - skipping
Could not find a version that satisfies the requirement requests (from versions: )
No matching distribution found for requests
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1056)'))) - skipping
So I looked all over internet and tried to find to bypass this and tried.
Tried trusted host but didn't work out
C:\python3.7>python -m pip install --index-url=http://pypi.org/simple --trusted-host pypi.org --proxy=http://proxypac.novartis.net:2010 requests
Looking in indexes: http://pypi.org/simple
Collecting requests
Could not find a version that satisfies the requirement requests (from versions: )
No matching distribution found for requests
Easy install with and without proxy
C:\python3.7>python -m easy_install requests
Searching for requests
Reading https://pypi.org/simple/requests/
Download error on https://pypi.org/simple/requests/: [Errno 11001] getaddrinfo failed -- Some packages may not be found!
Couldn't find index page for 'requests' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.org/simple/
Download error on https://pypi.org/simple/: [Errno 11001] getaddrinfo failed -- Some packages may not be found!
No local packages or working download links found for requests
error: Could not find suitable distribution for Requirement.parse('requests')
C:\python3.7>python -m easy_install requests --proxy=http://proxypac.novartis.net:2010
Searching for requests
Reading https://pypi.org/simple/requests/
Download error on https://pypi.org/simple/requests/: [Errno 11001] getaddrinfo failed -- Some packages may not be found!
Couldn't find index page for 'requests' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.org/simple/
Download error on https://pypi.org/simple/: [Errno 11001] getaddrinfo failed -- Some packages may not be found!
No local packages or working download links found for requests
error: Could not find suitable distribution for Requirement.parse('requests')
Trying to fetch from git
C:\python3.7>python -m pip install git+http://github.com/requests/requests.git
Collecting git+http://github.com/requests/requests.git
Cloning http://github.com/requests/requests.git to c:\users\gargta2\appdata\local\temp\pip-req-build-dnz33avh
fatal: unable to access 'http://github.com/requests/requests.git/': Could not resolve host: github.com
Command "git clone -q http://github.com/requests/requests.git C:\Users\gargta2\AppData\Local\Temp\pip-req-build-dnz33avh" failed with error code 128 in None
Not even working with wheel file. That is ridiculous.
C:\python3.7>python -m pip install requests-2.21.0-py2.py3-none-any.whl
Processing c:\python3.7\requests-2.21.0-py2.py3-none-any.whl
Collecting idna<2.9,>=2.5 (from requests==2.21.0)
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x039C3D90>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/idna/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x04567350>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/idna/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x04567D10>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/idna/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x04567FD0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/idna/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x04545F70>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/idna/
Could not find a version that satisfies the requirement idna<2.9,>=2.5 (from requests==2.21.0) (from versions: )
No matching distribution found for idna<2.9,>=2.5 (from requests==2.21.0)
As suggested in comments by #hoefling trying another command but it fails :(
C:\python3.7>python -m pip install requests -vvv --index-url=https://pypi.org/simple --trusted-host=pypi.org --trusted-host=files.pythonhosted.org --proxy=http://proxypac.novartis.net:2010?
Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
Created temporary directory: C:\Users\gargta2\AppData\Local\Temp\pip-ephem-wheel-cache-3r4pn3eq
Created temporary directory: C:\Users\gargta2\AppData\Local\Temp\pip-req-tracker-h3p1whde
Created requirements tracker 'C:\\Users\\gargta2\\AppData\\Local\\Temp\\pip-req-tracker-h3p1whde'
Created temporary directory: C:\Users\gargta2\AppData\Local\Temp\pip-install-k9yyg7yl
Collecting requests
1 location(s) to search for versions of requests:
* https://pypi.org/simple/requests/
Getting page https://pypi.org/simple/requests/
Starting new HTTPS connection (1): pypi.org:443
Incremented Retry for (url='/simple/requests/'): Retry(total=4, connect=None, read=None, redirect=None, status=None)
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1056)'))': /simple/requests/
Starting new HTTPS connection (2): pypi.org:443
Incremented Retry for (url='/simple/requests/'): Retry(total=3, connect=None, read=None, redirect=None, status=None)
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1056)'))': /simple/requests/
Starting new HTTPS connection (3): pypi.org:443
Incremented Retry for (url='/simple/requests/'): Retry(total=2, connect=None, read=None, redirect=None, status=None)
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1056)'))': /simple/requests/
Starting new HTTPS connection (4): pypi.org:443
Incremented Retry for (url='/simple/requests/'): Retry(total=1, connect=None, read=None, redirect=None, status=None)
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1056)'))': /simple/requests/
Starting new HTTPS connection (5): pypi.org:443
Incremented Retry for (url='/simple/requests/'): Retry(total=0, connect=None, read=None, redirect=None, status=None)
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1056)'))': /simple/requests/
Starting new HTTPS connection (6): pypi.org:443
Could not fetch URL https://pypi.org/simple/requests/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/requests/ (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1056)'))) - skipping
Could not find a version that satisfies the requirement requests (from versions: )
Cleaning up...
Removed build tracker 'C:\\Users\\gargta2\\AppData\\Local\\Temp\\pip-req-tracker-h3p1whde'
No matching distribution found for requests
Exception information:
Traceback (most recent call last):
File "C:\python3.7\lib\site-packages\pip\_internal\cli\base_command.py", line 143, in main
status = self.run(options, args)
File "C:\python3.7\lib\site-packages\pip\_internal\commands\install.py", line 318, in run
resolver.resolve(requirement_set)
File "C:\python3.7\lib\site-packages\pip\_internal\resolve.py", line 102, in resolve
self._resolve_one(requirement_set, req)
File "C:\python3.7\lib\site-packages\pip\_internal\resolve.py", line 256, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "C:\python3.7\lib\site-packages\pip\_internal\resolve.py", line 209, in _get_abstract_dist_for
self.require_hashes
File "C:\python3.7\lib\site-packages\pip\_internal\operations\prepare.py", line 218, in prepare_linked_requirement
req.populate_link(finder, upgrade_allowed, require_hashes)
File "C:\python3.7\lib\site-packages\pip\_internal\req\req_install.py", line 164, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "C:\python3.7\lib\site-packages\pip\_internal\index.py", line 621, in find_requirement
'No matching distribution found for %s' % req
pip._internal.exceptions.DistributionNotFound: No matching distribution found for requests
Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
1 location(s) to search for versions of pip:
* https://pypi.org/simple/pip/
Getting page https://pypi.org/simple/pip/
Starting new HTTPS connection (1): pypi.org:443
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1056)'))) - skipping
Also tried other methods
1. changing http with https
2. I don't see any pip.ini file
but none seem to be working.
Since your Networks firewall is blocking your access, you will need to tunnel your pip request, this link can help Connect to VPN by Powershell, after that you should be able to tunnel your Pip requests through, there are multiple VPN providers that you can use which allow passthrough connections, My Recommendations are NordVPN and DotVPN.
If you have additional queries about tunneling your connection through VPN you can have a look here https://learn.microsoft.com/en-us/powershell/module/vpnclient/add-vpnconnection?view=win10-ps.
Also if your networks firewall is blocking accessing to PyPi, they are most likely to block access to VPN, so I would recommend testing if the VPN you are trying to tunnel through is not blocked by your IP. There is an alternative to curl known as bitsadmin that you can use to verify if you have access to the vpn, or just use old fashioned ping.
P.S. Both the VPN's have free tier and that is what I recommend.
If it still doesn't work, comment down with the error.