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

No module named "urllib2" #7

Open
Cafeei opened this issue Feb 26, 2019 · 5 comments
Open

No module named "urllib2" #7

Cafeei opened this issue Feb 26, 2019 · 5 comments

Comments

@Cafeei
Copy link

Cafeei commented Feb 26, 2019

No description provided.

@Cafeei
Copy link
Author

Cafeei commented Feb 26, 2019

@madonuko
Copy link

havn't tried it out but apparently i encounted this issue in a fork repo. Seems like it is caused by not using python 3.5 it's quite outdated tbh.

@madonuko
Copy link

i know i am super late but idk why it hasn't been fixed. here's pip install output:

❯ sudo pip install duckduckgo
Collecting duckduckgo
  Downloading duckduckgo-0.1.tar.gz (2.9 kB)
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-hg8os7ko/duckduckgo/setup.py'"'"'; __file__='"'"'/tmp/pip-install-hg8os7ko/duckduckgo/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-y3g525o5
         cwd: /tmp/pip-install-hg8os7ko/duckduckgo/
    Complete output (7 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-hg8os7ko/duckduckgo/setup.py", line 2, in <module>
        from duckduckgo import __version__
      File "/tmp/pip-install-hg8os7ko/duckduckgo/duckduckgo.py", line 2, in <module>
        import urllib2
    ModuleNotFoundError: No module named 'urllib2'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

@madonuko
Copy link

fixed by installing package duckduckgo3 instead.

@HGStyle
Copy link

HGStyle commented Jan 18, 2023

if you have this error or an error with the package urllib2, i found a solution:
in the "duckduckgo.py" file, replace this line:

import urllib2

by this line:

import urllib.request as urllib2

this worked for me !

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

3 participants