python中的setuptools错误

我是python的新手,我正在安装python pakages但我收到此错误

Error:
    Traceback (most recent call last):
      File "setup.py", line 3 in <module>
        from setuptools import setup, find_packages
    ImportError: No module named setuptools

但是当我安装setuptools并运行它时,我收到此错误

Traceback (most recent call last):
  File "C:/Python32/yyy.py", line 7, in <module>
    execfile(convert_path('setuptools/command/__init__.py'), d)
NameError: name 'execfile' is not defined

我是Windows 7用户.如果有任何1有经验,请弄明白
 这是什么意思
解压缩归档文件,进入pyserial-x.y目录并运行?意味着我必须从命令提示符安装它

我想在python中使用twitter api.当我运行其安装文件时,它显示错误.我用记事本打开它并复制设置代码并将其粘贴到脚本中并使用yyy.py保存并运行它现在它给我这样的错误

File "C:\Python26\twittersetup.py",
line 13, in <module> 
long_description=open("./README", "r").read(), 
IOError: [Errno 2] No such file or directory: './README'

python 3.2中的这个错误

File "C:/Python32/t.py",
line 9, in <module> 
setup(name='twitter',
NameError: name 'setup' is not defined

现在,经过多次生存,我发现了这个错误

Traceback (most recent call last):
File "C:\Users\Sheikh\Desktop\twitter-1.9.0 (1).tar\twitter-1.9.0\setup.py",
line 47, 
in <module>""",File "C:\Python32\lib\distutils\core.py",
line 136, in setup
raise SystemExit(gen_usage(dist.script_name) + "\nerror: %s" % msg)
SystemExit: usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: no commands supplied

解决方法:

setuptools似乎不支持python 3(至少根据Python Package Index).

尝试分发,它提供setuptools api并提供python3兼容性:http://pypi.python.org/pypi/distribute

看起来python-twitter不支持python3所以你必须使用Python 2.6.

2.6错误消息非常清楚:

"C:\Python26\twittersetup.py", line 13, in <module> long_description=open("./README", "r").read(), IOError: [Errno 2] No such file or directory: './README') 

基本上,您尝试从包含README文件的目录以外的其他目录运行脚本.

我重新开始并确保你开始下载并解压缩python-twitter:http://pypi.python.org/packages/source/p/python-twitter/python-twitter-0.8.2.tar.gz的完整源代码

接下来,解压缩并解压缩源代码(7-Zip很适合这个).

然后打开cmd并cd到该解压缩目录(应该包含README文件和setup.py文件).然后运行如下:

C:\Python2.6\python2.6.exe setup.py
上一篇:如何告诉setup.py使用Visual Studio


下一篇:python – 使用setuptools / distribute打包资源