安装海报时出错(Python模块)
我正在尝试安装,以便可以使用HTTP POST查询从脚本中上载文件 在Python2.3上,当我键入安装海报时出错(Python模块),python,post,http-post,httppostedfile,http-post-vars,Python,Post,Http Post,Httppostedfile,Http Post Vars,我正在尝试安装,以便可以使用HTTP POST查询从脚本中上载文件 在Python2.3上,当我键入#python setup.py install时,我得到以下错误。安装仍在继续,但我以后无法导入海报 byte-compiling build/bdist.linux-x86_64/egg/poster/encode.py to encode.pyc File "build/bdist.linux-x86_64/egg/poster/encode.py", line 112 @cla
#python setup.py install
时,我得到以下错误。安装仍在继续,但我以后无法导入海报
byte-compiling build/bdist.linux-x86_64/egg/poster/encode.py to encode.pyc
File "build/bdist.linux-x86_64/egg/poster/encode.py", line 112
@classmethod
^
SyntaxError: invalid syntax
byte-compiling build/bdist.linux-x86_64/egg/poster/streaminghttp.py to streaminghttp.pyc
File "build/bdist.linux-x86_64/egg/poster/streaminghttp.py", line 114
newheaders = dict((k,v) for k,v in req.headers.items()
^
SyntaxError: invalid syntax
byte-compiling build/bdist.linux-x86_64/egg/poster/__init__.py to __init__.pyc
有什么指针吗?Python 2.3不支持decorators(这就是@classmethod)或列表理解(这是第二个错误),因此您要么必须找到旧版本的Poster,要么坚持使用urllib/urllib2来完成HTTP工作 实际上,这张海报似乎是在2008年7月左右创建的,所以即使您可以找到原始源代码,也不太可能有支持Python 2.3的版本。有什么特别的原因不能升级到最新的Python2.x吗