Where does pip save --cert data? - python

After trying to do a "pip3 list" on MacOS after installing Python3 with Homebrew and while connected to a corporate network and firewall, I got the below 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: self signed certificate in certificate chain (_ssl.c:1051)'))) - skipping
After some digging, I found this article. It works! Converting the company's .CER file to .PEM and then doing a "pip3 --cert root-cert.pem list" resolved the issue. However, where does the data get saved? Meaning, how does one revert the setting back to NULL or modify the setting without actually executing the command again using some phony .PEM file?

Related

Problem pip installing sqlalchemy-access due to a "Could not fetch URL" error

I'm using Jupyter notebooks with 32-bit Python. I'm using pip 21.2.4 and Python 3.9. When I try to install sqlalchemy-access
pip install sqlalchemy-access
I get these errors,
Could not fetch URL https://pypi.org/simple/sqlalchemy-access/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/sqlalchemy-access/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)'))) - skipping
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 (_ssl.c:1129)'))) - skipping
Note: you may need to restart the kernel to use updated packages.
One reccomendation I recieved was to try specifying the url using:
pip install --index-url=https://pypi.org/simple/sqlalchemy-access/
But then I just get another error
The current directory is invalid.
Any tips? Thanks!

Could not fetch URL, There was a problem confirming the ssl certificate & Could not find a version that satisfies the requirement Problem

I'm trying to install PyPDF4 in Anaconda. When I do pip install PyPDF2, it shows
Could not fetch URL https://pypi.org/simple/pypdf2/: There was a
problem confirming the ssl certificate:
HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded
with url: /simple/pypdf2/ (Caused by
SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED]
certificate verify failed: self signed certificate in certificate
chain (_ssl.c:1129)'))) - skipping 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: self signed certificate in certificate
chain (_ssl.c:1129)'))) - skipping
I also tried to install through pip install --index-url=https://pypi.org/simple/pip/ PyPDF2, but it still shows
Looking in indexes: https://pypi.org/simple/pip/ Could not fetch URL
https://pypi.org/simple/pip/pypdf2/: There was a problem confirming
the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443):
Max retries exceeded with url: /simple/pip/pypdf2/ (Caused by
SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED]
certificate verify failed: self signed certificate in certificate
chain (_ssl.c:1129)'))) - skipping Could not fetch URL
https://pypi.org/simple/pip/pip/: There was a problem confirming the
ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max
retries exceeded with url: /simple/pip/pip/ (Caused by
SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED]
certificate verify failed: self signed certificate in certificate
chain (_ssl.c:1129)'))) - skipping
I followed some guides online, and tried and install through pip3 install --trusted-host pypi.org --trusted-host files.pythonhosted.org pip PyPDF2, but it shows
ERROR: Could not find a version that satisfies the requirement PyPDF2
(from versions: none) ERROR: No matching distribution found for PyPDF2
instead. I did try to update Python version but it still didn't work (Python version 3.9.12)
Could anyone tell me how I should fix these problems?
Thank you!

Pip install from archive

I am trying to install Dtale in jupyter notebook. Due to the firewall restrictions, I cannot install it online. I tried to download the archive file dtale-2.2.0.tar.gz and ran this command inside the jupyter notes.
pip install <path>/dtale-2.2.0.tar.gz
This fails as it could not find pypandoc. Then I downloaded the pypandoc-1.7.5.tar.gz and ran
pip install <path>/pypandoc-1.7.5.tar.gz.
But this time I get the error:
ERROR: Could not install packages due to an OSError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/d2/04/08841501db81bceb7a86a98dea7c12b0185fcc69bfdf1aea266f727d1d7e/poetry_core-1.0.8-py2.py3-none-any.whl (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)')))
I know the host is unreachable due to the firewall, that is the reason why I downloaded the package. Can someone guide me through how to install the packages from the .gz archive file?
Thanks
this error tells you that there is a pkg in dependencies that can NOT be downloaded.
its name is poetry-core, so you should download and install it manually.
here is a url for it: https://files.pythonhosted.org/packages/d2/04/08841501db81bceb7a86a98dea7c12b0185fcc69bfdf1aea266f727d1d7e/poetry_core-1.0.8-py2.py3-none-any.whl
in case you can't download it too due to your firewall, you can use VPN.
in case you can't do that either, then you can download it from this url:
https://www.mediafire.com/file/kpnfupmf5px84um/poetry_core-1.0.8-py2.py3-none-any.whl/file
I have downloaded and re-uploaded it

Unable to download or update anything from both anaconda and pip on mac os

Suddenly I'm unable to download or update anything from both anaconda and pip on mac os.
When I'm trying to download or update from anaconda I get the following error:
CondaHTTPError: HTTP 000 CONNECTION FAILED for url https://conda.anaconda.org/soumith/osx-64/current_repodata.json
when trying to install something trough pip I get the following errors and warnings:
Could not fetch URL https://pypi.org/simple/certifi/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/certifi/ (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 certifi>=2017.4.17 (from requests->requests-html->facebook-scraper) (from versions: none)
ERROR: No matching distribution found for certifi>=2017.4.17 (from requests->requests-html->facebook-scraper)
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
Can anyone pls help?
Thanks!

'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate

First Issue:
I am using a MackBook Pro to run a python3 program in PyCharm that connects to MySQL ,when I run the program I receive
ModuleNotFoundError: No module named 'mysql
for line 1 which is
import mysql.connector
What i have tried:
I tried to install mysql using pip
pip3 install mysql-connector-python
new issue:
while executing
pip install mysql-connector-python
received:
Could not fetch URL https://pypi.org/simple/mysql-connector-python/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/mysql-connector-python/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)'))) - skipping
Could not find a version that satisfies the requirement mysql-connector-python (from versions: )
No matching distribution found for mysql-connector-python
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 (_ssl.c:1076)'))) - skipping"

Categories