Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip3 installed version doesn't support python 3? #14

Open
BlueHoopor opened this issue Oct 14, 2017 · 5 comments
Open

pip3 installed version doesn't support python 3? #14

BlueHoopor opened this issue Oct 14, 2017 · 5 comments

Comments

@BlueHoopor
Copy link

I installed torgnas with pip3 (Python 3.6 + Tornado 4.3). The demo can't run because of Python 2.x syntax such as :

except Exception, e:

after using 2to3-3.6, still can't run, here is the tornado log :

_[E 171014 09:15:18 http1connection:54] Uncaught exception

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/tornado/http1connection.py", line 238, in _read_message
    delegate.finish()
  File "/usr/local/lib/python3.6/site-packages/tornado/routing.py", line 251, in finish
    self.delegate.finish()
  File "/usr/local/lib/python3.6/site-packages/tornado/web.py", line 2096, in finish
    self.execute()
  File "/usr/local/lib/python3.6/site-packages/tornado/web.py", line 2129, in execute
    **self.path_kwargs)
  File "/usr/local/lib/python3.6/site-packages/torngas/handler.py", line 44, in _execute
    with stack_context.StackContext(functools.partial(ThreadlocalLikeRequestContext, **current_context)):
  File "/usr/local/lib/python3.6/site-packages/tornado/stack_context.py", line 137, in __enter__
    self.enter()
  File "/usr/local/lib/python3.6/site-packages/tornado/stack_context.py", line 122, in enter
    context.__enter__()
  File "/usr/local/lib/python3.6/site-packages/torngas/utils.py", line 411, in __enter__
    self._prev_data = self.__class__.data
AttributeError: type object 'ThreadlocalLikeRequestContext' has no attribute 'data'_
@leeyisoft
Copy link

我也遇到同样的问题,求解决方法 @mqingyn

@smoothjump
Copy link

smoothjump commented Feb 24, 2018 via email

@leeyisoft
Copy link

我没有用过 web.py ,不熟悉,能够解释的详细些吗? (我是想要在Python3下面把 torngas 正常运行起来,能够访问MySQL) @smoothjump @mqingyn

@smoothjump
Copy link

如果要在python3下面跑,不兼容的代码需要你自己改掉
或者你可以选择python 2.X,需要用python 2的解释器运行pip安装,3不是向后兼容的
以上的问题不是语法问题,ThreadlocalLikeRequestContext里面不存在‘data’属性,自己看代码吧

@leeyisoft
Copy link

tornado 现在都5.0了,据说Python3才是Python的未来,你不打算让torngas支持Python3吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants