setuptools: No module named sysconfig

  sre

reZqVf.jpg

 [root@mongo1 setuptools-40.6.3]# python setup.py install
Traceback (most recent call last):
  File "setup.py", line 11, in <module>
    import setuptools
  File "/root/pip-19.0.1/setuptools-40.6.3/setuptools/__init__.py", line 16, in <module>
    import setuptools.version
  File "/root/pip-19.0.1/setuptools-40.6.3/setuptools/version.py", line 1, in <module>
    import pkg_resources
  File "/root/pip-19.0.1/setuptools-40.6.3/pkg_resources/__init__.py", line 957, in <module>
    class Environment:
  File "/root/pip-19.0.1/setuptools-40.6.3/pkg_resources/__init__.py", line 961, in Environment
    self, search_path=None, platform=get_supported_platform(),
  File "/root/pip-19.0.1/setuptools-40.6.3/pkg_resources/__init__.py", line 188, in get_supported_platform
    plat = get_build_platform()
  File "/root/pip-19.0.1/setuptools-40.6.3/pkg_resources/__init__.py", line 391, in get_build_platform
    from sysconfig import get_platform
ImportError: No module named sysconfig

setuptools在37版本之后就不再支持python 2.6了
链接:https://github.com/pypa/setuptools/issues/878。
降低版本即可
pip install setuptools36.7.0
https://files.pythonhosted.org/packages/a9/5e/be163b88ee1c0093532e96ac68e42b840c5d85fd9888d8a96645ac5b71e4/setuptools-36.7.0.zip

LEAVE A COMMENT

Captcha Code