Tornado On RPi无法正常工作

时间:2015-10-26 22:52:21

标签: python python-2.7 tornado

您好我试图在我的Raspberry PI上使用tornado websockets而且我收到此错误

 File "socket.py", line 1, in <module>
    import tornado.httpserver
  File "/usr/local/lib/python2.7/dist-packages/tornado/httpserver.py", line 31, in <module>
    import socket
  File "/root/socket.py", line 2, in <module>
    import tornado.websocket
  File "/usr/local/lib/python2.7/dist-packages/tornado/websocket.py", line 28, in <module>
    import tornado.escape
  File "/usr/local/lib/python2.7/dist-packages/tornado/escape.py", line 31, in <module>
    from urllib.parse import parse_qs as _parse_qs  # py3
  File "/usr/lib/python2.7/urllib.py", line 850, in <module>
    class ftpwrapper:
  File "/usr/lib/python2.7/urllib.py", line 854, in ftpwrapper
    timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
AttributeError: 'module' object has no attribute '_GLOBAL_DEFAULT_TIMEOUT'

我正在使用的代码来自网站作为示例

1 个答案:

答案 0 :(得分:2)

请勿调用您的文件socket.py。它与同名的python库模块密切相关。

如果有socket.pyc,请确保删除boxes[boxes[6]]