Install the CQL shell

The CQL shell (cqlsh) is a Python-based command-line shell you can use to issue Cassandra Query Language (CQL) statements to your DataStax Enterprise (DSE) databases. The CQL shell also provides unique cqlsh commands like DESCRIBE KEYSPACE.

There are several ways to access the CQL shell, depending on your environment:

Environment CQL shell Notes

DSE tarball installation

Use the bundled CQL shell

A supported Python version is required

DSE package installation

Use the bundled CQL shell

A supported Python version is required

DSE not installed

Download and install the standalone CQL shell

A supported Python version is required

DSE Docker container

Use the bundled CQL shell

A supported Python version is required

Install Python

CQL shell requires Python.

DataStax recommends version 3.8 to 3.11. Later Python versions aren’t supported by DSE 5.1.

Use earlier versions (2.7, 3.6, or 3.7) only if required to support a legacy deployment running an early patch release of DSE 5.1 where your OS or the included cqlsh binary doesn’t support a recommended Python version.

If you have multiple Python versions installed, run cqlsh in a virtual environment that uses a supported Python version.

To verify your Python version, run python -V.

Early CentOS versions requiring Python 2.7

If you are running DSE 5.1 on an early CentOS version that requires Python 2.7, install it from the Software Collections (SCL) Repository:

  1. Run the following commands:

    sudo yum update
    sudo yum install scl-utils
    sudo yum install centos-release-scl-rh
    sudo yum install python27
    sudo scl enable python27 bash
  2. Check your Python version to confirm that it is 2.7.

  3. Restart the system, or log out and log back in, and then enable Python 2.7:

    sudo scl enable python27 bash

    Enabling Python 2.7 in .bash_profile or .bashrc causes the machine to hang because CentOS 6 relies on Python 2.6 for Yum.

Use the bundled CQL shell

Your DSE installation automatically includes cqlsh:

  • Package installations: cqlsh is installed automatically with DSE. You can run cqlsh from your system’s command line if it is in your system’s PATH. Otherwise, run it from the bin directory of your DSE installation.

  • Tarball installations: cqlsh is installed automatically with DSE. You can run cqlsh from the bin directory of your DSE installation directory.

  • DSE container: cqlsh is included with the container image. You can run cqlsh from the DSE bin directory inside the container, or start CQL shell with docker exec. For an example, see Attach to a container.

Install the standalone CQL shell

To install cqlsh without DSE, you need a cqlsh binary tarball. This tarball is included with DSE tarball fix packs on IBM Fix Central. The cqlsh binary cannot be extracted from DSE DEB/RPM packages.

Separate cqlsh binary tarballs are no longer provided; you must download the DSE tarball installation files, and then extract the standalone cqlsh binary tarball.

If you installed DSE from a tarball, you can use the cqlsh binary from your original tarball installation files.

  1. Find DSE tarball fix packs on IBM Fix Central.

    For compatibility, choose a fix pack version that aligns with your cluster’s DSE version.

    1. Go to Fix Central.

    2. In the Product selector field, begin typing IBM DataStax Enterprise, and then select that option from the menu.

    3. In the Release field, select the version that you want to install.

    4. Click Continue.

    5. On the Identify fixes page, click Continue to use the default Browse for fixes option.

    6. On the Select fixes page, select the fix pack (DSE version) you want to install, and then click Continue.

      Depending on the product and version, more fix packs might be available if you set the Platform filter to All, and then click Submit.

    7. If prompted, sign in with your IBMid.

      An IBMid account with MFA enabled is required. If you don’t have one, create an IBMid account. If your organization uses Enterprise Federation (EF) for authentication with corporate credentials, see the IBMid EF documentation.

    8. On the Download options page, select Download using your browser (HTTPS), and then click Continue.

    9. Review the terms and conditions, and then click I agree to activate the download links.

  2. Click the dse-VERSION-tgz.zip link to download the DSE tarball fix pack.

  3. Unzip the downloaded file to access the included cqlsh binary tarball (cqlsh-VERSION-bin.tar.gz).

  4. Extract the cqlsh distribution into the directory where you want to install cqlsh:

    tar -xzvf cqlsh-VERSION-bin.tar.gz -C /PATH/TO/INSTALL/DIRECTORY
  5. Optional: Validate the signatures (cqlsh-VERSION-bin.tar.gz.asc and cqlsh-VERSION-bin.tar.gz.cosign.sig), as explained in Install DataStax Enterprise (DSE) 5.1 with a binary tarball.

Was this helpful?

Give Feedback

How can we improve the documentation?

© Copyright IBM Corporation 2026 | Privacy policy | Terms of use |  Manage Privacy Choices

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: Contact IBM