Installing/updating conda or pypi packages via NIH VPN results in the HTTP 000 CONNECTION FAILED
error. This is strange coz when I copy and paste the conda URL and pypi URLin my browser, I'm able to access it.
Conda Error
$ conda install -c conda-forge r-mumin
Collecting package metadata (current_repodata.json): failed
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://conda.anaconda.org/conda-forge/osx-64/current_repodata.json>
Elapsed: -
An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
'https://conda.anaconda.org/conda-forge/osx-64'
PyPI Error
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(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate
- Open up pypi.org on firefox and found the NIH certificate that was being used for verification.
- Export the certificate to home directory, from KeyChain Access on Mac, in
.pem
format.
- For any pip/conda install commands, I use the --cert flag. For example -
pip install --cert ~/NIH-DPKI-ROOT-1A.pem dcm2bids
Adding the following line in my zshrc file saves me the trouble of specifying the --cert
flag but that said I'm not sure what's causing the issue to begin with.
export REQUESTS_CA_BUNDLE=/Users/arshithab/NIH-DPKI-ROOT-1A.pem
The above solutions didn't work while trying to install pycap over vpn (off campus). Here's the command that worked today:
pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org pycap