Traceback (most recent call last):
File "/usr/local/lib/python3.2/site-packages/cherrypy/_cpcompat.py",
line 203, 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 "<stdin>", line 1, in <module>
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 209, in <module>
from http.client import BadStatusLine, HTTPConnection,
HTTPSConnection, IncompleteRead, NotConnected
ImportError: cannot import name HTTPSConnection
Some sites suggest that I should install libssl-dev, which I did but
it did not help.
I found that there is a module
/usr/local/lib/python3.2/http/cookies.py (lower case, plural!) which
provides classes "SimpleCookie" and "CookieError".
Any suggestions?
-- tsf
Hi.
The Cookie/cookies exception is a red herring, the actual error is the
inability to import HTTPSConnection. Your python doesn't have SSL
support, which probably means you need to install the OpenSSL libraries,
whatever Ubuntu is calling them this week. Installing libssl-dev is a
good guess--did you reboot (or properly rerun ldconfig) after doing
that?
If you did compile it yourself (on ubuntu for example) you can visit /usr/lib/src/pythonX.X/ after installing the libssl package and rebuild python by running:
sudo python setup.py build
sudo python setup.py install
That will recognize the SSL libraries and properly configure them, which should then make sure you have an HTTPSConnection to import.
Hope that helps!
--
Eric Larson
On Tuesday, January 24, 2012 at 11:54 AM, Tsf wrote:
> I don't understand what you mean by "red herring". Anyway, I rebooted
> my machine and it still gives the same message :-(.
>
> -- tsf
>
> --
> You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
> To post to this group, send email to cherryp...@googlegroups.com (mailto:cherryp...@googlegroups.com).
> To unsubscribe from this group, send email to cherrypy-user...@googlegroups.com (mailto:cherrypy-user...@googlegroups.com).
> For more options, visit this group at http://groups.google.com/group/cherrypy-users?hl=en.
"Red herring" is a US colloquialism that means "something irrelevant
that distracts you from the real problem." A "red herring" can lead you
on a "wild goose chase". Computer people tend to be particularly
susceptible to red herrings.
A user brings a laptop in for service. He plugs it in and says "Look,
it won't run Excel any more." The technician says "hmm, did you notice
there is smoke coming from the keyboard?" User says "sure, but I need
to run Excel!"
The Excel part is a red herring...
--
Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.
Thanks Tim. My apologies for the US-centric term. If I may
elaborate...
In this case the Cookie ImportError exception is a "red herring" because
it looks scary and problematic, but actually it is meaningless with
respect to your problem and so only serves as a distraction. It is an
exception that is raised and then silently handled every time you run
CherryPy using Python 3. You only see it in your traceback because it
wasn't fully handled before another exception (the meaningful one) was
raised.
It's all water under the bridge (oops -- there's another one...) now
though, as fortunately you solved your problem.
Cheers!
Anders.
HTTPSConnection, IncompleteRead, NotConnected
ImportError: cannot import name HTTPSConnection
A post that I found helpful: