学以致用

focus on Python , C++, and some interest in Go and R

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::

将CentOS下的python版本升级到python2.7,通过easy_install安装cherrypy没问题,但在使用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 importSimpleCookie,CookieError
ImportError:Nomodule named http.cookies

google之后才知道是缺少因为python中ssl支持,具体解决方法如下:
(1)yum install openssl-devel
(2)重新编译安装python

参见:
http://stackoverflow.com/questions/6643052/importerror-no-module-named-http-cookies-error-when-installing-cherrypy-3-2
posted on 2011-11-03 14:21  Jerry.Kwan  阅读(2684)  评论(1)    收藏  举报