Unable to connect to cassandra using python in itversity

Hi Team,
I am trying to connect to Cassandra using python but not able to connect. Can you help me how to connect to it using python?

I tried by referring some of the solutions present online but I am getting Module import error as screenshot attached below:

Hi Team, could you please provide information on how to connect to Cassandra using python as normal python code which is working in local not working in itversity and I am not able to do any work in itversity.

Hi @Aditi_Naudiyal
you need to install Cassandra driver. Or you can follow this link to connect with Cassandra using terminal How to connect to Cassandra in itversity .

I am able to connect using terminal but need connect using python to write proper code.
I tried installing Cassandra driver using “pip install cassandra-driver” but I am getting error which is attached below :

Can you help me if anything is required from your side or I am doing any mistake here.

Hi @Aditi_Naudiyal
You need to upgrade pip first. Then run the command for installing Cassandra driver. please run this command to upgrade pip.

python3 -m pip install --upgrade pip

and after this run the pip command for installing Cassandra driver.

pip3 install cassandra-driver --user

please follow the screenshot for reference.


And then you can run your python file to connect with Cassandra

python3 filename.py

and if still you are not be able to connect please let me know.

@Avinash_Kumar Now it’s working. Thanks a lot for this