I have a local Pypi repository with simple-default layout. It has anonymous read access granted. I am using this repository to store my libraries.
After the upgrade from Artifactory 6.x to 7.x it is not possible to install any library using pip; it worked in 6.x. Following errors are returned on pip install my-python-lib:
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after
connection broken by 'ReadTimeoutError("HTTPConnectionPool(host='host', port=8081):
Read timed out. (read timeout=30.0)")': /artifactory/api/pypi/my-python-repo/simple/my-python-lib/
Could not install packages due to an EnvironmentError: HTTPConnectionPool(host='host', port=8081):
Max retries exceeded with url: /artifactory/api/pypi/my-python-repo/simple/my-python-lib/ (Caused by
ReadTimeoutError("HTTPConnectionPool(host='host', port=8081): Read timed out. (read timeout=30.0)"))
Setting longer --default-timeout doesn't work as well.
When I try to open host/artifactory/api/pypi/my-python-repo/simple/my-python-lib/ in the browser, it returns following error (after about 2 minutes):
502 Proxy Error
The proxy server received an invalid response from an
upstream server. The proxy server could not handle the request GET
/artifactory/api/pypi/my-python-repo/simple/my-python-lib/.
Reason: Error reading from remote server
It seems that a reverse proxy(Nginx or HTTPD) is configured on top of Artifactory and Artifactory 7.x has a different configuration when compared to Artifactory 6.x. I would recommend referring to this KB article for more insights.
I was not able to solve this for days, so if you can give me any advice I would appreciate it!
When I try to install any package from python I get this message (in this case lets take flask for example):
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/flask/
Could not find a version that satisfies the requirement Flask (from versions: )
No matching distribution found for Flask "
I do not really understand what caused it because previously everything worked well and I was able to install packages. And, I did not install anything new in between. Also, I am really a beginner in python programming and I do not fully understand what exactly the message is trying to say. I definitely have an internet connection and I have installed e.g. Flask previously and have used it as well. The only thing that happened before everything got stack was that my internet provider has "rebooted" my internet connection (I am not sure that "reboot" is the right termini for that).
I am using Windows subsystem for Linux, Visual studio code and python version: Python 3.6.8 (default, Oct 7 2019, 12:59:55) [GCC 8.3.0] on Linux.
This sounds like a DNS issue. Pip would be trying to resolve https://pypi.org. But ultimately that has to resolve to an IP Address.
Most ISPs provide a DNS service by default. Perhaps it wasn't able to resolve it?
When you added nameserver 8.8.8.8 you're using a Google DNS server which, it seems worked as expected by resolving https://pypi.org
I solved it by adding:
nameserver 8.8.8.8
nameserver 8.8.4.4
to the file:
/etc/resolv.conf
(via $sudo nano /etc/resolv.conf and save)
BUT I still do not understand fully why it worked? and Where came the problem from?
I want to install some modules in a Enterprise VM in order to create some Python Scripts. I'm trying to use PIP with Proxy to do it. I'm using this command lines:
C:\Users\user>SET HTTPS_PROXY=https://user:pass#199.00.11.11:8080
C:\Users\user>SET PROXY=http://user:pass#199.00.11.11:8080
C:\Users\user>pip install datetime
To have access to my virtual machine I've this credentials:
USER: NAN/user
PASS: pass
But I am getting this error:
Collecting datetime
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )',))': /simple/datetime/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )',))': /simple/datetime/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )',))': /simple/datetime/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )',))': /simple/datetime/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )',))': /simple/datetime/
Could not find a version that satisfies the requirement datetime (from versions: )
No matching distribution found for datetime
What I need to do in order to get the python module?
In my case, it was only because the 【VPN】 software modified the 【System Proxy】 configuration of the 【IE】 browser.
I modified it back in this way:
open 【IE】
Press 【Alt+X】 and scroll down to 【Internet options】
Click on the 【Connections】 tab
Press the 【LAN settings】 button
Uncheck the 【Proxy Server】
This is how my problem was successfully solved.
Try like this:
set HTTP_PROXY=http://199.00.11.11:8080
set HTTPS_PROXY=https://199.00.11.11:8080
First, install a proxy authentication service like CNTLM)
Second,
set http_proxy=http://username:password#proxyAddress:port
set https_proxy=https://username:password#proxyAddress:port
I also faced this issue even with proxy, adding "--isolated" helped
For eg: pip install datetime --isolated
Note: My proxy is already set in "pip config"
Use the following code
pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org datetime
You can change datetime with the name of any package you want.
I recently had a similar issue doing pip3 install awscli on my local mac. I checked my env and there were no proxies set there. The solution that worked for me was disabling proxies from the network which got set on my machine for some reason. To do that
Click on Wifi
Open Network Preferences
Click Advanced button
Go to proxies tab
Uncheck Web Proxy and Secure Web Proxy
Again, I know that network proxy misconfiguration is rare and this answer may not be the most suitable answer. But this might come in useful for some folks as this is right now the first link that comes on google search for pip install ProxyError.
This works on Windows 10 for me:
Search for Proxy Settings in Windows Start Search, open it
Under Manual Proxy Setup, uncheck "Use a proxy server".
Alternatively, you may just add exceptions for the sources you want to install packages from.
Try like: Go to *control panel --> Internet options --> Connections -->LAN Settings ->mark 'use proxy server for local address' options.
I ran into the same problem and the solution in my case was to unset the HTTPS_PROXY variable, because my proxy does not accept https requests.
I found the solution in this page : https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#https-proxy-error-http-proxy
All proxy variables are set by the os admin :
HTTP_PROXY=http://my_domain:8888
NO_PROXY=*.internal_domain,172.*,
HTTPS_PROXY=http://my_domain:8888
To update pip for example, I have to run :
unset HTTPS_PROXY ; pip install -U pip
If your proxy configration is OK,
It may be because your pip version is too high.
Try to lower your pip version
python -m pip install pip==19.3.1
Then restart your terminal.
You can try this method to see if it works
I'm trying to use Python 3.7 and PIP (on Windows 7) behind corporate firewall but I'm getting following error:
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed:
407 Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )',))': /simple/pywin32/
I've tried following configurations to pass proxy access and anyone of these is not working :(
set HTTP_PROXY=http://DOMAIN\user:pass#proxyhost:port
set HTTP_PROXY=http://user:pass#proxyhost:port
set HTTP_PROXY=http://proxyhost:port
I had a problem with my organization proxy auth too and was getting 407 errors in Windows OS, finally solved it using CTNLM , so first try to config ctnlm for your proxy and test it with your browser (the config is located in %PROGRAMFILES%\Cntlm\cntlm.ini for windows and default proxy should be something like http://localhost:3128) and if it worked give it to pip install : --proxy http://localhost:3128
I am on a closed network (aka no access to the internet) thus I need to create my own PyPi server. I am following the instructions here:
How to set up and use a private PyPI repo
The only differences:
I did not do was set up Apache authentication. No need for it.
I put everything in /src/pypi (all pointers were updated)
I was able to get Apache operational and (supposedly) got my ~/.pip/pip.conf file operational. Here are the contents:
[global]
extra-index-url=https://pypi.myserver.com/pypi/
trusted-host = pypi.myserver.com
When I try to run the command:
pip install foobar-utils
I get the following:
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at xxx>: Failed to establish a new connection: [Errorno -2] Name or service not known',)' /simple/foobar-utils
I know it's hitting apache, I see it in my logs.
Any help would be great. Thanks
If you want to completely replace PyPI you must use index-url instead of extra-index-url. With extra-index-url pip still search packages at https://pypi.org, extra-index-url is an additional server to search.
Your pip.conf must be
[global]
index=https://pypi.myserver.com/pypi/
index-url=https://pypi.myserver.com/pypi/
trusted-host = pypi.myserver.com
index is for pip search, index-url for pip install.