cannot import unquote from urllib

4 posts / 0 new
Last post
kumarkv
cannot import unquote from urllib

I have installed mapquest.

when i run import maq folloing error is occuring

ImportError: cannot import name 'unquote' from 'urllib' (C:\Users\ISK-FAC\AppData\Local\Programs\Python\Python38\lib\urllib\__init__.py)


kumarkv
edited the geo.py to update

edited the geo.py to update as below

from urllib import parse

issue solved. Thanks all


kumarkv
again getting below  error:

again getting below  error:

 

>>> mapq.address('155 9th St San Francisco, CA')
Traceback (most recent call last):
  File "<pyshell#3>", line 1, in <module>
    mapq.address('155 9th St San Francisco, CA')
  File "C:\Users\ISK-FAC\AppData\Local\Programs\Python\Python38\lib\site-packages\mapq\core.py", line 15, in address
    return Geo().address(name, **kwargs)
  File "C:\Users\ISK-FAC\AppData\Local\Programs\Python\Python38\lib\site-packages\mapq\geo.py", line 18, in __init__
    self._set_key(api_key)
  File "C:\Users\ISK-FAC\AppData\Local\Programs\Python\Python38\lib\site-packages\mapq\geo.py", line 28, in _set_key
    self.api_key = unquote(api_key)
NameError: name 'unquote' is not defined


kumarkv
SOLVED

SOLVED

added this line in geo.py

from urllib.parse import unquote