Astropy: SkyCoord.from_name() - module 'urllib.request' has no attribute 'HTTPSHandler'

44 Views Asked by At

I'm new to Python and just started learning this. I'm trying to figure out how to work with the Jupyter Notebook for searching for an object name in online databases. I wrote two versions of the code (for Betelgeuse and M1), but both versions give an error: module 'urllib.request' has no attribute 'HTTPSHandler'

from astropy.coordinates import SkyCoord, EarthLocation
betelgeuse = SkyCoord.from_name(’Betelgeuse’)
print(betelgeuse)

and:

from astropy import coordinates as coord
crab = SkyCoord.from_name('M1')
print(crab)

According to the urllib docs, If the Python installation has SSL support (i.e., if the ssl module can be imported), HTTPSHandler will also be added.

I tried to import ssl and import urllib.request by including the appropriate line at the very beginning of the code variants being compiled, but without success, the error persists.

I'm working in Jupyter Notebook at https://jupyter.org/try-jupyter/lab/index.html and would like to understand the reasons for the error. If I connect the modules incorrectly, I would like to learn. If these are shortcomings of the web version - I would like to get confirmation of this.

Many thanks!

0

There are 0 best solutions below