ERROR: Could not install packages due to an OSError: Could not find a suitable TLS CA certificate bundle

1.2k views Asked by At

Since downloading the new version of Postgres (Version 16.1) I am unable to properly work with pip. Therefore, I am unable to install packages, resulting in the following error:

ERROR: Could not install packages due to an OSError: Could not find a suitable TLS CA certificate bundle, invalid path: C:\Program Files\PostgreSQL\16\ssl\certs\ca-bundle.crt

I already tried to manually create a pip.ini file, in which I defined a path to my cacert.pem - fie. However, this did not change anything.

Any help on this issue or hints, where this might come from is greatly appreciated.

3

There are 3 answers

2
Talha Tayyab On

It says Invalid path:

Work around:

You can get the location of certifi by:

import certifi
certifi.where()

Keep this path of cacert.pem file handy.


You can get all the possible pip.ini files by running:

pip config -v list

Finally,

edit the pip.ini file and set the path = <file_path_of_cacert.pem>

0
sofiane khoudour On

Delete C:\Program Files\PostgreSQL\16\ssl\certs\ca-bundle.crt from System variables inside Environment variables worked for me

0
Halim Bezek On

That worked for me :

use trusted-host in either pip.conf or command line argument

You can ignore SSL errors by setting pypi.org and files.pythonhosted.org as well as the older pypi.python.org as trusted hosts.

$ pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org <package_name>

If you are still getting this error I suggest you review this answer

https://stackoverflow.com/a/29751768/10004902