ImportError: No module named cqlshlib

3,471 views
Skip to first unread message

Zakaria Hili

unread,
May 13, 2016, 5:20:24 AM5/13/16
to DataStax Python Driver for Apache Cassandra User Mailing List
I installed Cassandra 2.2.6 I want to run cqlsh (CQL interactive terminal of cassandra), but if I tried to run the command line :

cqlsh
I receive the error

  File "/usr/bin/cqlsh.py", line 165, in <module>
   
from cqlshlib import cql3handling, cqlhandling, pylexotron, sslhandling
ImportError: No module named cqlshlib

NB: I tried cassandra 3.0 and I got the same error, but I have no problem with cassandra 2.1 (I don't want to use Cassandra 2.1 because it doesn't support many queries):

com.impetus.kundera.configure.schema.SchemaGenerationException: Composite/Compound columns are not yet supported over Super column family by Cassandra

I tried to use python 2.6 and 2.7.6, but no result

My OS: centos 6.7

Alan Boudreault

unread,
May 13, 2016, 10:09:31 AM5/13/16
to python-dr...@lists.datastax.com
Hello Zakaria,

Can you give us more information on how Cassandra has been installed? Did you use a rpm package? Are you using Cassandra only or DSE?

Regards,
Alan

--
You received this message because you are subscribed to the Google Groups "DataStax Python Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-driver-u...@lists.datastax.com.



--

Alan Boudreault
Software Engineer (Drivers) | alan.bo...@datastax.com


Zakaria Hili

unread,
May 15, 2016, 4:21:33 PM5/15/16
to DataStax Python Driver for Apache Cassandra User Mailing List
Hi Alan,

I installed cassandra using command line :
yum install dsc22

Zakaria Hili

unread,
May 16, 2016, 3:16:54 AM5/16/16
to DataStax Python Driver for Apache Cassandra User Mailing List
for your question about dse, yes I'm using datastax entreprise
regards,
zakaria

Le vendredi 13 mai 2016 11:20:24 UTC+2, Zakaria Hili a écrit :

Michael Shuler

unread,
May 16, 2016, 12:38:23 PM5/16/16
to DataStax Python Driver for Apache Cassandra User Mailing List
If you have a way to run on CentOS-7.0 or later, you should have no issues with cqlsh. cqlsh/cqlshlib require python-2.7, even though there is no dependency on it in the rpm packages. This was done to allow installation on older CentOS/RHEL versions, but then you need to work out python problems on your own, essentially. If you absolutely have no other option but to use CentOS-6, I understand the most successful way to install python-2.7 is to use the SDL packages. Once installed, you activate the python-2.7 installation and you get a chroot and functional python-2.7 install. I don't know a ton about it, but I've had issues going down this route, too. Centos-7 "just works", so that's my suggestion.

Erik Hoekstra

unread,
Jun 20, 2016, 10:27:38 AM6/20/16
to DataStax Python Driver for Apache Cassandra User Mailing List
Try to simlink the python 2.7 lib mismatch

/usr/lib/python2.7/site-packages
vs
/usr/local/lib/python2.7/site-packages

The following worked for me:

# cqlsh
Traceback (most recent call last):
  File "/usr/bin/cqlsh.py", line 167, in <module>

    from cqlshlib import cql3handling, cqlhandling, pylexotron, sslhandling
ImportError: No module named cqlshlib


cd /usr/lib/python2.7/
mv * /usr/local/lib/python2.7/site-packages/
rm -R site-packages
ln -s /usr/local/lib/python2.7/site-packages ./


# cqlsh
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.6.0 | CQL spec 3.4.2 | Native protocol v4]
Use HELP for help.
cqlsh>



Op maandag 16 mei 2016 18:38:23 UTC+2 schreef Michael Shuler:
Reply all
Reply to author
Forward
0 new messages