Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSL/URL error when trying to connect to HITRAN via hapi #50

Open
emccaughey opened this issue May 20, 2024 · 0 comments
Open

SSL/URL error when trying to connect to HITRAN via hapi #50

emccaughey opened this issue May 20, 2024 · 0 comments

Comments

@emccaughey
Copy link

I have been trying to connect to HITRAN via hapi and and keep receiving an ssl/url error.

I am using a macOS 14.4.1 with python 3.9.13. I am able to access HITRAN.org via any web browser, but am not able to fetch data using hapi.

I have tried using this fix with a variety of HAPI versions, with no luck.

I have also seen some other people online who may be having this same issue.

One Error:

HAPI version: 1.2.2.0
To get the most up-to-date version please check http://hitran.org/hapi
ATTENTION: Python versions of partition sums from TIPS-2021 are now available in HAPI code

           MIT license: Copyright 2021 HITRAN team, see more at http://hitran.org. 

           If you use HAPI in your research or software development,
           please cite it using the following reference:
           R.V. Kochanov, I.E. Gordon, L.S. Rothman, P. Wcislo, C. Hill, J.S. Wilzewski,
           HITRAN Application Programming Interface (HAPI): A comprehensive approach
           to working with spectroscopic data, J. Quant. Spectrosc. Radiat. Transfer 177, 15-30 (2016)
           DOI: 10.1016/j.jqsrt.2016.03.005

           ATTENTION: This is the core version of the HITRAN Application Programming Interface.
                      For more efficient implementation of the absorption coefficient routine, 
                      as well as for new profiles, parameters and other functional,
                      please consider using HAPI2 extension library.
                      HAPI2 package is available at http://github.com/hitranonline/hapi2

Using lahetra


Data is fetched from http://hitran.org

Traceback (most recent call last):

  File "/Users/erinmccaughey/Desktop/hapi_tests/hapi.py", line 3276, in queryHITRAN
    req = urllib2.urlopen(url)

  File "/Users/erinmccaughey/opt/anaconda3/lib/python3.9/urllib/request.py", line 214, in urlopen
    return opener.open(url, data, timeout)

  File "/Users/erinmccaughey/opt/anaconda3/lib/python3.9/urllib/request.py", line 523, in open
    response = meth(req, response)

  File "/Users/erinmccaughey/opt/anaconda3/lib/python3.9/urllib/request.py", line 632, in http_response
    response = self.parent.error(

  File "/Users/erinmccaughey/opt/anaconda3/lib/python3.9/urllib/request.py", line 555, in error
    result = self._call_chain(*args)

  File "/Users/erinmccaughey/opt/anaconda3/lib/python3.9/urllib/request.py", line 494, in _call_chain
    result = func(*args)

  File "/Users/erinmccaughey/opt/anaconda3/lib/python3.9/urllib/request.py", line 747, in http_error_302
    return self.parent.open(new, timeout=req.timeout)

  File "/Users/erinmccaughey/opt/anaconda3/lib/python3.9/urllib/request.py", line 517, in open
    response = self._open(req, data)

  File "/Users/erinmccaughey/opt/anaconda3/lib/python3.9/urllib/request.py", line 539, in _open
    return self._call_chain(self.handle_open, 'unknown',

  File "/Users/erinmccaughey/opt/anaconda3/lib/python3.9/urllib/request.py", line 494, in _call_chain
    result = func(*args)

  File "/Users/erinmccaughey/opt/anaconda3/lib/python3.9/urllib/request.py", line 1417, in unknown_open
    raise URLError('unknown url type: %s' % type)

URLError: <urlopen error unknown url type: https>


During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File "/Users/erinmccaughey/opt/anaconda3/lib/python3.9/site-packages/spyder_kernels/py3compat.py", line 356, in compat_exec
    exec(code, globals, locals)

  File "/Users/erinmccaughey/Desktop/hapi_tests/hapi_test.py", line 23, in <module>
    fetch_by_ids('co2_sdv_6056cm_primary',[7],6056,6064,ParameterGroups=['160-char','SDVoigt_Air'])

  File "/Users/erinmccaughey/Desktop/hapi_tests/hapi.py", line 5324, in fetch_by_ids
    queryHITRAN(

  File "/Users/erinmccaughey/Desktop/hapi_tests/hapi.py", line 3281, in queryHITRAN
    raise Exception(

Exception: Cannot connect to http://hitran.org. Try again or edit GLOBAL_HOST variable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant