2

cql是否支持python3?

我尝试使用 pip 安装,但失败了。

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

事实上 cql 依赖于 Thrift 可能不支持 python3

有什么解决办法??

4

3 回答 3

5

Thrift 确实明确不支持 Python 3,它的元数据被标记为仅支持 Python 2,安装它会给你一个语法错误。

解决方案是联系 Thrift 的作者并帮助他们移植到 Python 3。完成后,帮助移植 cql。更新通常很容易(某些特殊情况除外)而且很有趣!

于 2013-06-30T12:33:09.410 回答
4

不,该cql库与 Python 3兼容。它依赖于thrift,一个本身兼容Python 3 的包:

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本身使用相同的过时语法cqltypes.py

except (ValueError, AssertionError, IndexError), e:

两者都thrift需要cql先移植。

于 2013-06-30T12:32:25.707 回答
-1

对于 Python 3,您可以使用CQLEngine

于 2014-09-15T11:55:28.463 回答