首页 > 代码库 > ImportError: No module named setuptools

ImportError: No module named setuptools

报错:

[root@localhost rpy2-2.8.5]# python setup.py install
Traceback (most recent call last):
  File "setup.py", line 7, in <module>
    from setuptools import setup, Extension
ImportError: No module named setuptools

解决办法,下载

[root@localhost rpy2-2.8.5]# wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz
--2017-03-09 01:59:42--  http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz
Resolving pypi.python.org... 151.101.76.223, 2a04:4e42:12::223
Connecting to pypi.python.org|151.101.76.223|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz [following]
--2017-03-09 01:59:42--  https://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz
Connecting to pypi.python.org|151.101.76.223|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 256862 (251K) [application/octet-stream]
Saving to: “setuptools-0.6c11.tar.gz”

100%[=============================================================================================================================>] 256,862      786K/s   in 0.3s    

2017-03-09 01:59:43 (786 KB/s) - “setuptools-0.6c11.tar.gz” saved [256862/256862]

安装

[root@localhost setuptools-0.6c11]# python setup.py build
[root@localhost setuptools-0.6c11]# python setup.py install

 

ImportError: No module named setuptools