3

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??

rabit
  • 235
  • 2
  • 10

3 Answers3

6

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!

Lennart Regebro
  • 167,292
  • 41
  • 224
  • 251
4

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.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
-1

For Python 3, you can use CQLEngine.

spideringweb
  • 3,534
  • 2
  • 14
  • 17