I'm trying to run the scanpypi script - support script of the Buildroot (2017.02) but I'm getting the ImportError: cannot import name get_importer.
Traceback (most recent call last): File "./support/scripts/scanpypi", line 52, in import setuptools File "/usr/local/lib/python2.7/dist-packages/setuptools/init.py", line 12, in import setuptools.version File "/usr/local/lib/python2.7/dist-packages/setuptools/version.py", line 1, in import pkg_resources File "/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py", line 40, in from pkgutil import get_importer ImportError: cannot import name get_importer
I added the following lines into beginning of the scanpypi script to see sys.path
- import sys
- print(sys.path)
output:
['/home/timo/bldr_lab/buildroot/support/scripts', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages']
As the pkgutil is in the /usr/lib/python2.7 directory the problem is not path problem.
I have also uninstalled and re-installed python2.7, pip and setuptools but no help.
What could be reason for the ImportError?
python -c 'import pkgutil; print(pkgutil.__file__)
? – Anthony Sottilepudb
but in the debugger it works like a charm. I've triedscanpypi
on different Linux distros and all show the same behavior. – yegorich