python3.2上的cherrypy导入错误
我在 centos5.5
上安装了 python3.2&cherrypy3.2
,但是当我尝试运行 helloworld 时,我收到以下消息:
Traceback (most recent call last): File "/usr/local/lib/python3.2/site-packages/cherrypy/_cpcompat.py", line 179, in <module>
from Cookie import SimpleCookie, CookieError ImportError: No module named Cookie
在处理上述异常期间,另一个发生异常:
Traceback (most recent call last): File "tut01_helloworld.py", line 8, in <module>
import cherrypy File "/usr/local/lib/python3.2/site-packages/cherrypy/__init__.py", line 62, in <module>
from cherrypy._cpcompat import urljoin as _urljoin, urlencode as
_urlencode File "/usr/local/lib/python3.2/site-packages/cherrypy/_cpcompat.py", line 185, in <module>
from http.client import BadStatusLine, HTTPConnection, HTTPSConnection, IncompleteRead, NotConnected ImportError: cannot import name HTTPSConnection
有什么问题吗?
I installed python3.2&cherrypy3.2
on my centos5.5
, but when I tried to run helloworld I got the following message:
Traceback (most recent call last): File "/usr/local/lib/python3.2/site-packages/cherrypy/_cpcompat.py", line 179, in <module>
from Cookie import SimpleCookie, CookieError ImportError: No module named Cookie
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "tut01_helloworld.py", line 8, in <module>
import cherrypy File "/usr/local/lib/python3.2/site-packages/cherrypy/__init__.py", line 62, in <module>
from cherrypy._cpcompat import urljoin as _urljoin, urlencode as
_urlencode File "/usr/local/lib/python3.2/site-packages/cherrypy/_cpcompat.py", line 185, in <module>
from http.client import BadStatusLine, HTTPConnection, HTTPSConnection, IncompleteRead, NotConnected ImportError: cannot import name HTTPSConnection
Is anything wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您无法导入 HTTPSConnection 模块,我怀疑这意味着您的 Python 中缺少 SSL 支持。为此,您可能需要为您的 Linux 发行版安装 openssl 开发包。
例如在 Ubuntu 上:
You can't import the HTTPSConnection module, which I suspect means that you are missing SSL support in your Python. To get that you probably need to install the openssl development package for your Linux distro.
Like, for example on Ubuntu: