OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

OSError: Could not find a suitable TLS CA certificate bundle

  • Thread starter Thread starter Notmyname
  • Start date Start date
N

Notmyname

Guest
when making Api requests to binance , after building main.py to exe using pyinstaller, I get this error:

Code:
OSError: Could not find a suitable TLS CA certificate bundle, invalid path: C:\Users\ADMINI~1\AppData\Local\Temp\2\_MEI76602\certifi\cacert.pem

on the server where I run the bot and this on local machine:

Code:
OSError: Could not find a suitable TLS CA certificate bundle, invalid path: C:\Users\USER\PycharmProjects\pythonproject2\dist\cacert.pem

the exact location of error for both is:

Code:
File "requests\adapters.py", line 227, in cert_verify

On the server the program had been running for over a week non stop with no problems until 2 days ago when I started getting the OSError. But only API calls caused the error with the program still running, the websockets were still receiving data.

I tried adding the code in the accepted answer of python requests can't find a folder with a certificate when converted to .exe

I also tried:

Code:
pip config set global.cert "path\to\cacert.pem"

with the correct path to cacert.pem, found using

Code:
python -c "import certifi; print(certifi.where())"

Non of that worked, currently the only workaround I found is to manually copy the cacert.pem file into the location where the OSError says it was looking for it (the cacert.pem file).

But I never had to do this before. Recently I updated my python version then downgraded again because of websocket problems. I did this by completely uninstalling python 3.10 and removing all references from PATH then reinstalled 3.9.7 and added all the PATH variables.

Does anyone have any idea what could be causing this? When I run the script in pycharm itself, I dont get this error, I also noticed that the global.cert is not the same path as OSError on local machine, but I have no idea how to change where it looks from cacert.pem file.
<p>when making Api requests to binance , after building main.py to exe using pyinstaller, I get this error:</p>
<pre><code>OSError: Could not find a suitable TLS CA certificate bundle, invalid path: C:\Users\ADMINI~1\AppData\Local\Temp\2\_MEI76602\certifi\cacert.pem
</code></pre>
<p>on the server where I run the bot and this on local machine:</p>
<pre><code>OSError: Could not find a suitable TLS CA certificate bundle, invalid path: C:\Users\USER\PycharmProjects\pythonproject2\dist\cacert.pem
</code></pre>
<p>the exact location of error for both is:</p>
<pre><code>File "requests\adapters.py", line 227, in cert_verify
</code></pre>
<p>On the server the program had been running for over a week non stop with no problems until 2 days ago when I started getting the OSError. But only API calls caused the error with the program still running, the websockets were still receiving data.</p>
<p>I tried adding the code in the accepted answer of <a href="https://stackoverflow.com/questions...lder-with-a-certificate-when-converted-to-exe">python requests can&#39;t find a folder with a certificate when converted to .exe</a></p>
<p>I also tried:</p>
<pre><code>pip config set global.cert "path\to\cacert.pem"
</code></pre>
<p>with the correct path to cacert.pem, found using</p>
<pre><code>python -c "import certifi; print(certifi.where())"
</code></pre>
<p>Non of that worked, currently the only workaround I found is to manually copy the cacert.pem file into the location where the OSError says it was looking for it (the cacert.pem file).</p>
<p>But I never had to do this before. Recently I updated my python version then downgraded again because of websocket problems. I did this by completely uninstalling python 3.10 and removing all references from PATH then reinstalled 3.9.7 and added all the PATH variables.</p>
<p>Does anyone have any idea what could be causing this? When I run the script in pycharm itself, I dont get this error, I also noticed that the global.cert is not the same path as OSError on local machine, but I have no idea how to change where it looks from cacert.pem file.</p>
 

Latest posts

Online statistics

Members online
0
Guests online
6
Total visitors
6
Top