我在Linux機器上安裝cherrypy 3.2(在Ubuntu和Centos上)時遇到問題。我在機器上安裝了最新的Python和Pip(版本2.7)。在Ubuntu上,我使用$ sudo pip install cherrypy。在centos上,我是從源代碼安裝的。ImportError:安裝cherrypy時沒有名爲http.cookies的模塊3.2
後安裝完成併成功,導入CherryPy的模塊時,我得到的錯誤:
>>> import cherrypy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/cherrypy/__init__.py", line 62, in <module>
from cherrypy._cpcompat import urljoin as _urljoin, urlencode as _urlencode
File "/usr/local/lib/python2.7/site-packages/cherrypy/_cpcompat.py", line 184, in <module>
from http.cookies import SimpleCookie, CookieError
ImportError: No module named http.cookies
>>>
我擡頭的文檔,似乎http.cookies是Python 3中,我失去了什麼既機我試過很乾淨,從未安裝過python 3?
好的問題通過降級到Cherrypy 3.1.2解決。 – ycseattle