Does cql support python 3?

断了今生、忘了曾经 提交于 2019-12-11 13:12:43

问题


Does cql has support python3?

I tried to install with pip but it failed.

rabit@localhost:/usr/bin> pip-3.3 install cql
^CDownloading/unpacking cql
Operation cancelled by user
Storing complete log in /home/rabit/.pip/pip.log
rabit@localhost:/usr/bin> sudo pip-3.3 install cql
root's password:
Downloading/unpacking cql
  Downloading cql-1.4.0.tar.gz (76kB): 76kB downloaded
  Running setup.py egg_info for package cql

Downloading/unpacking thrift (from cql)
  Running setup.py egg_info for package thrift
    Traceback (most recent call last):
      File "<string>", line 16, in <module>
      File "/tmp/pip-build/thrift/setup.py", line 45
        except DistutilsPlatformError, x:
                                     ^
    SyntaxError: invalid syntax
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 16, in <module>

  File "/tmp/pip-build/thrift/setup.py", line 45

    except DistutilsPlatformError, x:

                                 ^

SyntaxError: invalid syntax

----------------------------------------
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build/thrift

In fact cql is dependent on Thrift which probably not support python3

Any solution??


回答1:


Thrift does indeed explicitly not support Python 3, it's metadata is marked as supporting Python 2 only, and installing it gives you a Syntax error.

The solution is to contact the authors of Thrift and help them port to Python 3. and once that is done, help port cql. Updating is usually easy (except in some special cases) and fun!




回答2:


No, the cql library is not compatible with Python 3. It relies on thrift, a package that is not Python 3 compatible itself:

Traceback (most recent call last):
  File "<string>", line 16, in <module>
  File "/Users/mj/Development/venvs/stackoverflow-3.3/build/thrift/setup.py", line 45
    except DistutilsPlatformError, x:
                                 ^
SyntaxError: invalid syntax

cql itself uses the same obsolete syntax in cqltypes.py:

except (ValueError, AssertionError, IndexError), e:

Both thrift and cql need to be ported first.




回答3:


For Python 3, you can use CQLEngine.



来源:https://stackoverflow.com/questions/17390367/does-cql-support-python-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!