python3.2上的cherrypy导入错误

发布于 2024-11-06 10:38:43 字数 981 浏览 1 评论 0原文

我在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

笑着哭最痛 2024-11-13 10:38:43

您无法导入 HTTPSConnection 模块,我怀疑这意味着您的 Python 中缺少 SSL 支持。为此,您可能需要为您的 Linux 发行版安装 openssl 开发包。

例如在 Ubuntu 上:

 sudo apt-get install libssl-dev

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:

 sudo apt-get install libssl-dev
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文