Search code examples
pythonpython-2.7python-import

Python ImportError: cannot import name utils


I'm having this issue running a script and it looks like it missed some dependencies, but as you can see below. After installing the missing libraries, it doesn't make any sense.

[ericfoss@maverick-fossum-ddns-net packages]$ python -c "import utils"
[ericfoss@maverick-fossum-ddns-net packages]$ python -c "import requests"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/requests/__init__.py", line 64, in <module>
    from . import utils
ImportError: cannot import name utils
[ericfoss@maverick-fossum-ddns-net packages]$ 

Any idea why utils can be imported, but requests can't?


Solution

  • Well, after pip uninstall requests and reinstalling, it would no longer work. Luckily, `pip install python-requests' fixed the whole thing...