I get this error:
Could not install packages due to an EnvironmentError: Could not find a suitable TLS CA certificate bundle, invalid path: /home/yosra/Desktop/CERT.RSA
When I run: $ virtualenv venv
So I put a random CERT.RSA on the Desktop which worked and I created my virtual environment, but then when I run: pip install -r requirements.txt
I got this one:
Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host='github.com', port=443): Max retries exceeded with url: /KristianOellegaard/django-hvad/archive/2.0.0-beta.tar.gz (Caused by SSLError(SSLError(0, 'unknown error (_ssl.c:3715)'),))
I feel that these 2 errors are linked to each other, but I want to know how can I fix the first one?
You can contact the customer support team of your vendor or CA and request them to provide the CA bundle. If you have bought your SSL certificate from RapidSSLonline.com, you can easily access the CA bundle from here.
CA Bundle is the file that contains root and intermediate certificates. Together with your server certificate (issued specifically for your domain), these files complete the SSL chain of trust. The chain is required to improve the compatibility of the certificates with web browsers, email clients, and mobile devices.
update-ca-certificates is a program that updates the directory /etc/ssl/certs to hold SSL certificates and generates ca-certificates. crt, a concatenated single-file list of certificates. It reads the file /etc/ca-certificates.
If you're on Mac (mine is 10.13.6), use the following command:
(security find-certificate -a -p ls /System/Library/Keychains/SystemRootCertificates.keychain && security find-certificate -a -p ls /Library/Keychains/System.keychain) > $HOME/.mac-ca-roots
Then do modify .bashrc
with
export REQUESTS_CA_BUNDLE="$HOME/.mac-ca-roots"
Then do
$ source ~/.bashrc
You need to allow pip to reference to the correct certificate. check the certificate first;
python -c "import certifi; print(certifi.where())"
Then first test it manually;
pip install -r requirements.txt --cert=<the above certificate path>
If that works fine, then update this path on pip.conf file located at $HOME/.pip/pip.conf (or %APPDATA%\pip\pip.ini on Windows). e.g.
[global]
cert = /usr/local/share/ca-certificate/mycert.crt
In Windows 10, 1. Find the location of certifi with following commands to check if installed already
import certifi
certifi.where()
Note down the path of cacert.pem file
Search for the pip.ini file in windows explorer and edit the file in notepad and set the path = <file path of cacert.pem >
I received this error while running the command as "pip install flask" in Pycharm.
If you look at the error, you will see that the error points out to "packages due to an EnvironmentError: Could not find a suitable TLS CA certificate bundle -- Invalid path
".
I solved this by removing the environment variable "REQUESTS_CA_BUNDLE
" OR you can just change the name of the environment variable "REQUESTS_CA_BUNDLE
" to some other name.
Restart your Pycharm and this should be solved.
Thank you !
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With