pip install failing with 407 Proxy Authentication Required - authentication

I am trying to use the below pip install command, but its failing with Proxy authentication required issue. I have already configured my proxies inside my RHEL7.x Server.
Command Used: `pip install --proxy https://'username:pwd'#proxy:host --upgrade pip`
Logs:
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 407 Proxy Authentication Required',))': /simple/pip/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 407 Proxy Authentication Required',))': /simple/pip/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 407 Proxy Authentication Required',))': /simple/pip/
Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 407 Proxy Authentication Required',))': /simple/pip/
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 407 Proxy Authentication Required',))': /simple/pip/

This is the first thing you should try:
Open the command prompt(CMD).
Export the proxy settings :
:\set http_proxy=http://username:password#proxyAddress:port
:\set https_proxy=https://username:password#proxyAddress:port
Install the package you want to install:
:\pip install PackageName

Error 407 means that the authentication for the proxy is missing / wrong. Remove the ' from the username:pwd part, i.e. use: pip install --proxy https://username:pwd#proxy:host.
Try opening an internet connection from that server just prior to installing the Python package, as another option.
If this is not helping, try the the options given in the answers to the questions here, here and here.

Open the terminal then execute:
export http_proxy=http://username:password#proxyAddress:port
export https_proxy=https://username:password#proxyAddress:port
I try this in git bash, in Windows.
I did not find a better answer with no password in a environment variable.
You could save this code, creating a ".bashrc" file in your home directory.

There's authentication problem while connecting to proxy which causes 407 proxy issue.
Execute following commands to set proxy for your system.
set HTTPS_PROXY=https://User_Name:Password#proxy_address:Port
set https_proxy=https://User_Name:Password#proxy_address:Port
set HTTP_PROXY=http://User_Name:Password#proxy_address:Port
set http_proxy=http://User_Name:Password#proxy_address:Port
Note: Check your environment environment variable has HTTP_PROXY/ HTTPS_PROXY variable set. If Yes, verify if those are set to correct values.
As these values overwrite your current values.

Related

In Sage: No module named 'Crypto' --> ssl errors with pip

I see from this answer that the solution is to run:
sage --pip install pycrypto
Yet, when I try this, I get the following error:
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pycrypto/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pycrypto/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pycrypto/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pycrypto/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pycrypto/
Could not fetch URL https://pypi.org/simple/pycrypto/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pycrypto/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
ERROR: Could not find a version that satisfies the requirement pycrypto (from versions: none)
ERROR: No matching distribution found for pycrypto
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
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("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
Since you have Sage 9.2, I would suggest upgrading.
The best way to do so depends on
whether you intend to develop Sage or only use it
what extra packages you need to install with Sage
If you
only intend to use Sage
only need pip-installable packages
then consider installing the latest Sage-macOS from
https://github.com/3-manifolds/Sage_macOS/releases
Then launch Sage and, at the Sage prompt, run
%pip install pycrypto
and similarly for any pip-installable packages you need.
Then quit Sage and launch it again.

SSL Certificate/Module error - pip 19.2.3 - Anaconda Prompt

First off, let me say I'm a beginner programmer and so far I managed to 'get away' without understanding too much about virtual environments, command prompts, Python shells, so please apologise if I don't understand the terminology that well (yet, I am reading about it second day now).
I am using Windows 10 and Anaconda, Python 3.7.7, Spyder 4.2.1., iPython shell 7.13.
So far I installed packages using the console (iPython) and pip install, successfully, no problems there at all. However, now I have to create a virtual environment as part of a WebDevelopment course I am doing.
I managed to create a new environment (as part of an existing directory, the server) using the Anaconda prompt, and activate it. That seemed to work. Then I had to install Flask.
(Before, the unaware Me, installed it using pip in the console, and it worked, but obviously this is not in the environment I want for my project).
And just trying pip install flask (as well as pip3 install flask), from within the activated virtual environment (webServer), gave me the error:
(webServer) C:\Users\path\to\directory\Python\project>pip install
Flask WARNING: pip is configured with locations that require TLS/SSL,
however the ssl module in Python is not available. Collecting Flask
WARNING: Retrying (Retry(total=4, connect=None, read=None,
redirect=None, status=None)) after connection broken by
'SSLError("Can't connect to HTTPS URL because the SSL module is not
available.")': /simple/flask/ WARNING: Retrying (Retry(total=3,
connect=None, read=None, redirect=None, status=None)) after connection
broken by 'SSLError("Can't connect to HTTPS URL because the SSL module
is not available.")': /simple/flask/ WARNING: Retrying
(Retry(total=2, connect=None, read=None, redirect=None, status=None))
after connection broken by 'SSLError("Can't connect to HTTPS URL
because the SSL module is not available.")': /simple/flask/ WARNING:
Retrying (Retry(total=1, connect=None, read=None, redirect=None,
status=None)) after connection broken by 'SSLError("Can't connect to
HTTPS URL because the SSL module is not available.")': /simple/flask/
WARNING: Retrying (Retry(total=0, connect=None, read=None,
redirect=None, status=None)) after connection broken by
'SSLError("Can't connect to HTTPS URL because the SSL module is not
available.")': /simple/flask/ Could not fetch URL
https://pypi.org/simple/flask/: There was a problem confirming the ssl
certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max
retries exceeded with url: /simple/flask/ (Caused by SSLError("Can't
connect to HTTPS URL because the SSL module is not available.")) -
skipping ERROR: Could not find a version that satisfies the
requirement Flask (from versions: none) ERROR: No matching
distribution found for Flask WARNING: pip is configured with locations
that require TLS/SSL, however the ssl module in Python is not
available. 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("Can't connect to HTTPS URL
because the SSL module is not available.")) - skipping
I have been reading about this error and I tried various things suggested, such as:
pip install --upgrade --user pip --trusted-host=pypi.python.org --trusted-host=pypi.org --trusted-host=files.pythonhosted.org
as well as
curl https://bootstrap.pypa.io/get-pip.py >> get-pip.py
python get-pip.py
Neither of these change anything. This is the first time I encounter this, because so far all my installations have been from the console, using the pip that is in the main Anaconda directory.
pip definitely exists in the site packages of the newly installed virtual environment though.
And here my basic knowledge is insufficient to get if it is something due to Anaconda, due to the new environment I set up, etc.
Any help will be appreciated.
PS For anyone who encounters this:
After a lot of digging and trial and error, I solved the problem by adding :
C:\Users\User\Anaconda3\Library\bin
to my PATH list of Environmental variables.

NewConnectionError when trying to install Tensorflow on Windows 10 with python 3.5

I am currently trying to install tensorflow with Python 3.5 and I am running into a new connection error. I am trying to follow the install guide from tensorflow. Has anyone seen this issue before and figured out a solution? Thanks.
c:\>pip3 install --upgrade tensorflow
Collecting tensorflow
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x000002245E6C30F0>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it',)': /simple/tensorflow/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x000002245E6D0470>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it',)': /simple/tensorflow/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x000002245E6D05C0>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond',)': /simple/tensorflow/
Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x000002245E6D0710>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it',)': /simple/tensorflow/
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x000002245E6D0860>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it',)': /simple/tensorflow/
Could not find a version that satisfies the requirement tensorflow (from versions: )
No matching distribution found for tensorflow
This is not definitive, but I would suggest a few actions:
Consider testing from another machine on the same network, or even a different network, to test for actual network issues you might have.
This might be a temporary issue with the server, try again later.
Try to install some other package with pip, to rule out possible problems with your pip itself
Installing tensorflow doesn't have to be done with pip, you can either follow this link to install via anaconda, or this link to install tensorflow from source (however, source installations are not officially supported on windows)
In my case, the connection was blocked by Kaspersky. Temporary switching it off solved my issue.

Setup TFS plugin in Jenkins to access TFS server

This is just to share my problem and solution to everyone.
I setup the plugin with the instructions from
https://wiki.jenkins-ci.org/display/JENKINS/Team+Foundation+Server+Plugin
First problem:
FATAL: com.microsoft.tfs.core.exceptions.TECoreException: Connection refused
java.lang.RuntimeException: com.microsoft.tfs.core.exceptions.TECoreException: Connection refused
Second problem:
FATAL: com.microsoft.tfs.core.exceptions.TECoreException: Unrecognized SSL message, plaintext connection?
java.lang.RuntimeException: com.microsoft.tfs.core.exceptions.TECoreException: Unrecognized SSL message, plaintext connection?
First problem:
FATAL: com.microsoft.tfs.core.exceptions.TECoreException: Connection refused
java.lang.RuntimeException: com.microsoft.tfs.core.exceptions.TECoreException: Connection refused
This is due to the firewall between my Linux Jenkins server and the Windows TFS server. I had Network team open the port 8080 and 443 from the Jenkins server to the TFS server.
That fixed the first problem.
Second problem:
FATAL: com.microsoft.tfs.core.exceptions.TECoreException: Unrecognized SSL message, plaintext connection?
java.lang.RuntimeException: com.microsoft.tfs.core.exceptions.TECoreException: Unrecognized SSL message, plaintext connection?
This is due to my incorrect URL to the TFS DefaultCollection
I used the https for "Server URL". This will demande a SSL certificate to be install on the Jenkins linux server.
https://swcosvctfs01.wco.int:8080/tfs/DefaultCollection/
After switching to http as below, the error went away, and Jenkins was able to checkout a copy of the TFS sourcecodes successfully.
http://swcosvctfs01.wco.int:8080/tfs/DefaultCollection/

SSL connection between eDirectory and OpenLDAP

I use a State Machine Driver to connect our eDirectory (Source) to a OpenLDAP Directory (Destination).
Without SSL everything is fine...but only for testing.
Now i need to use SSL.
I activated use-ssl (Driver Configuration -> Driver Parameters) and give the path to a keystore.
I add a self-signed-certificate of the OpenLDAP-Server to the keystore.
After restarting the driver i get (servername replaced by xxxx):
java.net.ConnectException: Connection refused
16:12:15 FFFFFFFFFAA5D700 Drvrs: eDir-OpenLDAP PT:eDir-OpenLDAP: Schema.Schema() - LDAPException: Unable to connect to server xxxx:636 (91) Connect Error
java.net.ConnectException: Connection refused
I used /opt/novell/eDirectory/lib/nds-modules/jre/lib/security/cacerts as keystore.
What could i try next to get the SSL-connection running?
Thank you for reading this question!
The problem is solved.
Port 636 was closed on the destination server.
Thank you for the hint Bruno.