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

AttributeError: module 'urllib.request' has no attribute 'HTTPSHandler' #88

Open
magalive1991 opened this issue Jan 11, 2023 · 5 comments

Comments

@magalive1991
Copy link

Hello here, for a couple of months now I'm getting the error in the title when running gcexport.py, I just downloaded the most recent version of the package and still have the same error. The problem is this line of code:

OPENER = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(COOKIE_JAR), urllib.request.HTTPSHandler(debuglevel=0))

I investigated and it can seem like a python 2 vs python 3 error but I checked and I use python 3.9 so it should work. Can anyone help ? Thanks a lot

@centic9
Copy link

centic9 commented Jan 11, 2023

Maybe your version of module urllib.request is outdated?

Which version do you have installed? On Debian/Ubuntu it is provided by package python3-urllib3

The README does currently not state any minimum required version, would be good to list it as part of the installation steps.

@magalive1991
Copy link
Author

magalive1991 commented Jan 12, 2023

thanks for your answer, I am on windows and do have urllib3 installed

pip install urllib3
Requirement already satisfied: urllib3

pip show urllib3
Name: urllib3
Version: 1.26.14
(last version)

@magalive1991
Copy link
Author

edit. it's working in anaconda prompt but not in command prompt

@bxsx
Copy link
Contributor

bxsx commented Jan 16, 2023

You don't need urllib3, this project uses the urllib from the standard library.

I would start the investigation from here: https://docs.python.org/3/library/urllib.request.html#urllib.request.build_opener

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

@pe-st
Copy link
Owner

pe-st commented Jan 22, 2023

bxsx is right, the project doesn't use urllib3 (there is no import urllib3...)

When you add a line (at around line 30 of gcexport.py)

import ssl

do you still get the same error? Or something like ModuleNotFoundError: No module named 'ssl' ?

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

4 participants