Datastax Python cassandra driver build fails on Ubuntu
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
Datastax cassandra-driver (python) failed import
Well, it looks like names conflict. Your script is cassandra.py
and so it is the module for the driver. Try to rename your script (and don't forget to delete its .pyc
) and try again
error while trying to install cassandra-driver using python
i'm able to install cassandra-driver successfully using following command,
command:
pip install cassandra-driver --install-option="--no-cython"
Following is the complete installation log(fyi):
C:\Windows\System32>pip install cassandra-driver --install-option="--no-cython"
c:\python27\lib\site-packages\pip\commands\install.py:194: UserWarning: Disablin
g all use of wheels due to the use of --build-options / --global-options / --ins
tall-options.
cmdoptions.check_install_build_global(options)
Collecting cassandra-driver
c:\python27\lib\site-packages\pip\_vendor\requests\packages\urllib3\util\ssl_.py
:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Na
me Indication) extension to TLS is not available on this platform. This may caus
e the server to present an incorrect TLS certificate, which can cause validation
failures. You can upgrade to a newer version of Python to solve this. For more
information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissi
ngwarning.
SNIMissingWarning
c:\python27\lib\site-packages\pip\_vendor\requests\packages\urllib3\util\ssl_.py
:122: InsecurePlatformWarning: A true SSLContext object is not available. This p
revents urllib3 from configuring SSL appropriately and may cause certain SSL con
nections to fail. You can upgrade to a newer version of Python to solve this. Fo
r more information, see https://urllib3.readthedocs.io/en/latest/security.html#i
nsecureplatformwarning.
InsecurePlatformWarning
Using cached cassandra-driver-3.9.0.tar.gz
Requirement already satisfied: six>=1.6 in c:\python27\lib\site-packages (from c
assandra-driver)
Requirement already satisfied: futures in c:\python27\lib\site-packages (from ca
ssandra-driver)
Skipping bdist_wheel for cassandra-driver, due to binaries being disabled for it
.
Installing collected packages: cassandra-driver
Running setup.py install for cassandra-driver ... done
Successfully installed cassandra-driver-3.9.0
Cassandra python driver - undefined symbol
In case someone is experiencing the same issue, after many attempts, I solved it building the package using an EC2 instance running the Amazon Linux AMI.
I don't know actually the exact reason, but pip via virtualenv was not generating the lib64 folder on my laptop (Ubuntu 16.04), which I got instead on the EC2 instances and that has been populated with additional files while installing the cassandra-driver package and related dependencies (futures, six).
Cassandra Python driver doesn't page large queries
Your test is invalid because your code is faulty.
When you list()
, you are in fact "materialising" all the result pages. Your code is not iterating over the rows but retrieving all of the rows.
The driver automatically fetches the next page in the background until there are no more pages to fetch. It may not seem like it but each page only contains fetch_size
rows.
Retrieving the next page happens transparently so to you it seems like the results are not getting paged at all but that automatic behaviour from the driver is working as designed. Cheers!
Related Topics
Getting Another Program's Output as Input on the Fly
Find Broken Symlinks with Python
Why Does Simple Echo in Subprocess Not Working
Linux Bash Script Running Multiple Python
Copy Data from the Clipboard on Linux, MAC and Windows with a Single Python Script
How to Split My 800X480 5-Inch Screen into 2 Parts
How to Show Pil Image in Ipython Notebook
How to Parse the Output of /Proc/Net/Dev into Key:Value Pairs Per Interface Using Python
How to Get the Owner and Group of a Folder with Python on a Linux MAChine
Standard Way to Open a Folder Window in Linux
How to Deal with Linux/Python Dependencies
Read, Highlight, Save PDF Programmatically
Process Dies, If It Is Run via Paramiko Ssh Session and with "&" in the End