Для начала
Python 3.4 Tornado последний из тарбола
Пытаюсь завести хелоуворлд из примера в доке
import tornado.httputil
import tornado.httpserver
import tornado.ioloop
def handle_request(request):
message = "You requested %s\n" % request.uri
request.connection.write_headers(
httputil.ResponseStartLine('HTTP/1.1', 200, 'OK'), {"Content-Length": str(len(message))})
request.connection.write(message)
request.connection.finish()
http_server = tornado.httpserver.HTTPServer(handle_request)
http_server.listen(8888)
tornado.ioloop.IOLoop.instance().start()
Получаю
/usr/bin/python3.4 /home/valor/dev/PyScripts/cam-srvice/main.py
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/tornado-4.0.2-py3.4-linux-x86_64.egg/tornado/httputil.py", line 39, in <module>
import Cookie # py2
ImportError: No module named 'Cookie'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/valor/dev/PyScripts/cam-srvice/main.py", line 30, in <module>
from tornado import httputil
File "/usr/local/lib/python3.4/dist-packages/tornado-4.0.2-py3.4-linux-x86_64.egg/tornado/httputil.py", line 41, in <module>
import http.cookies as Cookie # py3
ImportError: No module named 'http.cookies'
Ну вроде бы понятно, модуля нет.. Однако он есть в системе он есть.
Я ничего не понимаю. даже если сделать просто import http.cookies as Cookie, тоже не пашет..
Это как ?
Если сделать из консоли
valor@asshurt:/usr/lib/python3.4$ python3.4
python3.4 python3.4-config python3.4m python3.4m-config
valor@asshurt:/usr/lib/python3.4$ python3.4
Python 3.4.2 (default, Oct 8 2014, 10:45:20)
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import http.cookies as Cookie
>>> Cookie.
Cookie.BaseCookie( Cookie._LegalCharsPatt Cookie.__class__( Cookie.__file__ Cookie.__init__( Cookie.__new__( Cookie.__sizeof__( Cookie._nulljoin( Cookie.re
Cookie.CookieError( Cookie._OctalPatt Cookie.__delattr__( Cookie.__format__( Cookie.__le__( Cookie.__package__ Cookie.__spec__ Cookie._quote( Cookie.string
Cookie.Morsel( Cookie._QuotePatt Cookie.__dict__ Cookie.__ge__( Cookie.__loader__ Cookie.__reduce__( Cookie.__str__( Cookie._semispacejoin(
Cookie.SimpleCookie( Cookie._Translator Cookie.__dir__( Cookie.__getattribute__( Cookie.__lt__( Cookie.__reduce_ex__( Cookie.__subclasshook__( Cookie._spacejoin(
Cookie._CookiePattern Cookie.__all__ Cookie.__doc__ Cookie.__gt__( Cookie.__name__ Cookie.__repr__( Cookie._getdate( Cookie._unquote(
Cookie._LegalChars Cookie.__cached__ Cookie.__eq__( Cookie.__hash__( Cookie.__ne__( Cookie.__setattr__( Cookie._monthname Cookie._weekdayname
>>> Cookie.__all__
['CookieError', 'BaseCookie', 'SimpleCookie']
>>>
То вроде ок..