Cassandra CQLSH : ImportError: No module named _ssl

To successfully run Cassandra CQLSH, openssl-devel packages must be installed. During operating system installation, openssl package is installed, but not openssl-devel.

To overcome this error, install openssl-devel as supplied with the operating system. In RedHat Linux 6, this rpm is present in Packages directory.

[cassandra@orcl1 bin]$ ./cqlsh
Traceback (most recent call last):
File "/home/cassandra/apache-cassandra-3.7/bin/cqlsh.py", line 167, in <module>
from cqlshlib import cql3handling, cqlhandling, pylexotron, sslhandling
File "/home/cassandra/apache-cassandra-3.7/bin/../pylib/cqlshlib/sslhandling.py", line 20, in <module>
import ssl
File "/usr/local/lib/python2.7/ssl.py", line 97, in <module>
import _ssl # if we can't import it, let the error propagate
ImportError: No module named _ssl

Install following packages. openssl-devel has dependens with other rpms. Hence, install all the packages mentioned below :

[root@orcl1 Packages]# rpm -ivh openssl-devel-1.0.1e-15.el6.x86_64.rpm \
krb5-devel-1.10.3-10.el6_4.6.x86_64.rpm \
keyutils-libs-devel-1.4-4.el6.x86_64.rpm \
libcom_err-devel-1.41.12-18.el6.x86_64.rpm \
libselinux-devel-2.0.94-5.3.el6_4.1.x86_64.rpm \
libsepol-devel-2.0.41-4.el6.x86_64.rpm \
zlib-devel-1.2.3-29.el6.x86_64.rpm warning: openssl-devel-1.0.1e-15.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing... ########################################### [100%]
1:libsepol-devel ########################################### [ 17%]
2:libselinux-devel ########################################### [ 33%]
3:libcom_err-devel ########################################### [ 50%]
4:keyutils-libs-devel ########################################### [ 67%]
5:krb5-devel ########################################### [ 83%]
6:openssl-devel ########################################### [100%]

Now, execute cqlsh.

./cqlsh

You should be able to connect to cqlsh now

Comments