我尝试使用命令在Ubuntu 12.04.3服务器下安装CherryPy:
sudo python3.3 setup.py install似乎一切都很好。
但是在运行测试时:
python3.3 -c "import cherrypy"它给出了一个错误:
Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/local/lib/python3.3/dist-packages/cherrypy/__init__.py", line 82, in <module> from cherrypy import process File "/usr/local/lib/python3.3/dist-packages/cherrypy/process/__init__.py", line 14, in <module> from cherrypy.process import plugins, servers File "/usr/local/lib/python3.3/dist-packages/cherrypy/process/plugins.py", line 424, in <module> class PerpetualTimer(threading._Timer): AttributeError: 'module' object has no attribute '_Timer'做同样的事情
python2.7 -c "import cherrypy"它没有输出。
会是什么呢?
最好的问候,列昂尼德
I tried to install CherryPy under Ubuntu 12.04.3 server with command:
sudo python3.3 setup.py installIt seems that everything was fine.
But when running test:
python3.3 -c "import cherrypy"it gives an error:
Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/local/lib/python3.3/dist-packages/cherrypy/__init__.py", line 82, in <module> from cherrypy import process File "/usr/local/lib/python3.3/dist-packages/cherrypy/process/__init__.py", line 14, in <module> from cherrypy.process import plugins, servers File "/usr/local/lib/python3.3/dist-packages/cherrypy/process/plugins.py", line 424, in <module> class PerpetualTimer(threading._Timer): AttributeError: 'module' object has no attribute '_Timer'When doing the same with
python2.7 -c "import cherrypy"it gives no output.
What could it be?
Best regards, Leonid
最满意答案
“Timer类在Python 3.3中从_Timer重命名为Timer”
https://bitbucket.org/cherrypy/cherrypy/issue/1163/attributeerror-in-cherrypyprocessplugins
希望这可以帮助!
I have downloaded CherryPy 3.2.3 from python.org (https://pypi.python.org/pypi/CherryPy/3.2.3) instead of 3.2.2 taken from cherrypy.org (http://download.cherrypy.org/cherrypy/3.2.2/) used before and run installation process once more.
Now it works for some reason...
更多推荐
发布评论