Datastax Python cassandra driver driver not working on Ubuntu

I tried to install the Datastax Python Cassandra driver on Ubuntu 14.04.5. LTS. The installation succeeds, but a subsequent attempt to use it fails:

  Welcome to Ubuntu 14.04.5 LTS (GNU / Linux 3.13.0-91-generic x86_64)
 ~ $ python3 --version
 Python 3.5.2
 ~ $ python3 -c 'import cassandra;  print (cassandra .__ version__) '
 3.7.0
 ~ $ python3 cassandra_loader.py
 Traceback (most recent call last):
   File "cassandra_loader.py", line 7, in 
     from cassandra_tools import transform_record, QueryManager
   File "../lib/cassandra_tools.py", line 6, in 
     from cassandra.cluster import Cluster
   ImportError: /usr/local/lib/python3.5/site-packages/cassandra/cluster.cpython-35m-x86_64-linux-gnu.so: undefined symbol: PyException_Check

the same installation process and the same code work well on RedHat. A Google search for an error code returns nothing. Anyone have an idea what could be the problem?

+6
source share
2 answers

This is a duplicate of this question: cluster.cpython-34m.so: undefined: PyException_Check

I answered this, but here is a copy of the answer, as I can not comment.


The latest version of Cython (0.25) released today broke the cassandra-driver.

A workaround for this problem is to set Cython == 0.24.1 before installing the cassandra driver.

(env) $ pip install Cython==0.24.1 (env) $ pip install cassandra-driver

You may need to first remove the existing cassandra-driver package from the site packages:

rm -r $WHERE_PYTHON_IS_INSTALLED/lib/python2.7/site-packages/cassandra*

For more details see https://datastax-oss.atlassian.net/browse/PYTHON-656

+3
source

We just released a patch version 3.7.1 to fix this problem caused by the new version of Cython. Update the cassandra driver:

  pip install --upgrade cassandra-driver 
+1
source

Source: https://habr.com/ru/post/1011698/


All Articles