Spynner 文档说它支持 Python >=26,但在安装过程中出现以下错误:
(spynner) spynner$ pip3 install spynner
Requirement already satisfied (use --upgrade to upgrade): spynner in /Users/spynner/Envs/spynner/lib/python3.4/site-packages/spynner-2.19-py3.4.egg
Collecting six (from spynner)
Using cached six-1.10.0-py2.py3-none-any.whl
Collecting beautifulsoup4 (from spynner)
Using cached beautifulsoup4-4.5.1-py3-none-any.whl
Collecting unittest2 (from spynner)
Using cached unittest2-1.1.0-py2.py3-none-any.whl
Collecting pyquery (from spynner)
Using cached pyquery-1.2.13.tar.gz
Collecting autopy (from spynner)
Using cached autopy-0.51.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/zl/dpw1svbx2qjbl549qvzq2r640000gn/T/pip-build-3rvrid_c/autopy/setup.py", line 50
print 'Updating __init__.py'
^
SyntaxError: Missing parentheses in call to 'print'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/zl/dpw1svbx2qjbl549qvzq2r640000gn/T/pip-build-3rvrid_c/autopy/
所以看起来其中一个包是为 2.7 编写的。
我可以做一些 Python 技巧来让它与 Python 3 一起工作,还是我必须去手动更正有问题的代码?
干杯