我试图在Ubuntu 14.04.5上安装Datastax Python Cassandra驱动程序. LTS.安装成功但后续尝试使用它失败并显示错误:
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
这是这个问题的重复:
cluster.cpython-34m.so: undefined symbol: PyException_Check
我在那里回答了,但这里是答案的副本,因为我无法发表评论.
最新版本的Cython(0.25)今天发布了cassandra-driver.
解决此问题的方法是在安装cassandra-driver之前安装Cython == 0.24.1.
(env)$pip install Cython == 0.24.1
(env)$pip install cassandra-driver
您可能需要首先从site-packages中删除现有的cassandra-driver软件包:
rm -r $WHERE_PYTHON_IS_INSTALLED / lib / python2.7 / site-packages / cassandra *
有关更多信息,请参见https://datastax-oss.atlassian.net/browse/PYTHON-656