hitranonline / hapi

HITRAN Application Programming Interface (HAPI)
Other
75 stars 35 forks source link

Cannot connect to hitran #8

Open robbertbloem opened 5 years ago

robbertbloem commented 5 years ago

I have a problem connecting to the hitran database using the api. I use the following code:

import hapi
hapi.db_begin('data')
hapi.fetch('H2O',1,1,3400,4100)

and get a "SSLCertVerificationError". I attached the full trace as a file. log.txt I found this discussion online: https://bugs.python.org/issue36866 It may be related?

I use MacOS 10.14.5, Python 3.7.3, hitran-api 1.1.0.9.6 (and also with version 1.1.0.9.0).

robbertbloem commented 5 years ago

I checked on a Windows 10 Enterprise x64 machine and it does work correctly. I am using Python 3.7.3 and hitran-api 1.1.0.9.0. On my Mac urllib2 is installed, but urllib3 is not. On the Windows computer urllib3 is installed, but urllib2 is not.

MrAnimaniac commented 1 year ago

I assume I have the same error using Windows 11. Tried Python 3.9.7 and 3.10.8 with miniconda, anaconda and without conda always after fresh install - always the same issue.

It works however fine on my windows 10 machine.

Any idea on how to solve it?

hapi_connect_error.txt

Update: it somehow sorted itself out. I used my mobile phone as a hotspot and was able to get a connection to hitran. Now it is also working with my normal WLAN. Furthermore, I installed jupyterlab git. Doing this may have updated or installed ca-certificates, if I'm not mistaken. However, I wasn't really paying attention. Perhaps it may help someone else with the same issue...

sam88-student commented 1 year ago

I have the same issue .. any one know how to solve this ?

erwanp commented 1 year ago

Still there?

marina8888 commented 3 months ago

Hello, I am still having this issue even with certifi installed.

urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain

(_ssl.c:1122)>

Adding the following code: ssl._create_default_https_context = ssl._create_unverified_context urllib.request.urlopen("https://hitran.org/")"

Causes the following issue even after deleting the download files. Happy to hear any advice or if anyone was able to solve.

raise OSError(

OSError: Problem opening : None. See above. You may want to delete the download files. """

The above exception was the direct cause of the following exception: OSError: Problem opening : None. See above. You may want to delete the downloaded file.