Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

linux - Datastax Python cassandra driver build fails on Ubuntu

I was trying to install Datastax Python Cassandra driver on Ubuntu 14.04.5. LTS. Installation succeeds but subsequent attempt to use it fails with the error:

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

same installation process and same code works well on RedHat. Google search for error code returns nothing. Anybody has an idea of what could be the issue?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

I answered it there but here is copy of the answer as I can't comment.


Latest version of Cython (0.25) released today broke cassandra-driver.

Workaround for this issue it to install Cython==0.24.1 before installing cassandra-driver.

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

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

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

See https://datastax-oss.atlassian.net/browse/PYTHON-656 for more information


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...