最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【已解决】Python中使用setup.py install去安装别的模块结果出错:ImportError: No module named setuptools

Python crifan 16852浏览 0评论

【问题】

在折腾:

【记录】折腾Python中的一个绘制图表的模块:pycha

的过程中,去使用setup.py install安装pychar,结果出错:

D:\tmp\dev_tools\python\pycha\dist\pycha-0.6.0>setup.py install
Traceback (most recent call last):
  File "D:\tmp\dev_tools\python\pycha\dist\pycha-0.6.0\setup.py", line 19, in <module>
    from setuptools import setup
ImportError: No module named setuptools

【解决过程】

1.很明显,是没有安装setuptools。

但是很诡异的是,之前记得好像是使用过多次setup.py install,一直是正常的啊。

2.网上随便搜了下,找到python官网:

http://pypi.python.org/pypi/setuptools

然后去安装和我当前环境

win7 x64

python 2.7.3

相匹配的

http://peak.telecommunity.com/dist/ez_setup.py

3.然后再去运行:

D:\tmp\dev_tools\python\setuptools>ez_setup.py
Downloading http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg
Processing setuptools-0.6c11-py2.7.egg
Copying setuptools-0.6c11-py2.7.egg to d:\tmp\dev_install_root\python27_x64\lib\site-packages
Adding setuptools 0.6c11 to easy-install.pth file
Installing easy_install-script.py script to D:\tmp\dev_install_root\Python27_x64\Scripts
Installing easy_install.exe script to D:\tmp\dev_install_root\Python27_x64\Scripts
Installing easy_install.exe.manifest script to D:\tmp\dev_install_root\Python27_x64\Scripts
Installing easy_install-2.7-script.py script to D:\tmp\dev_install_root\Python27_x64\Scripts
Installing easy_install-2.7.exe script to D:\tmp\dev_install_root\Python27_x64\Scripts
Installing easy_install-2.7.exe.manifest script to D:\tmp\dev_install_root\Python27_x64\Scripts

Installed d:\tmp\dev_install_root\python27_x64\lib\site-packages\setuptools-0.6c11-py2.7.egg
Processing dependencies for setuptools==0.6c11
Finished processing dependencies for setuptools==0.6c11

 

貌似就安装好了。

【总结】

难道是我之前记错了,竟然之前没有安装过setuptools?

那么之前安装了那么多python的模块,难道都是双击exe的???

总之,无语了。。。

转载请注明:在路上 » 【已解决】Python中使用setup.py install去安装别的模块结果出错:ImportError: No module named setuptools

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
89 queries in 0.167 seconds, using 22.11MB memory