1

I am new to Cassandra and trying to setup it on Linux version 2.6.18-404.el5 with Java 8 64 bit. I have tried Cassandra version 3.3. and 2.2.5 and getting an error:

cqlsh
File "./cqlsh.py", line 686
ssl_options=sslhandling.ssl_settings(hostname, CONFIG_FILE) if ssl else None, ^
SyntaxError: invalid syntax

It is reporting a syntax error on 'if'

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Sushil
  • 327
  • 1
  • 3
  • 20
  • 1
    You need python 2.7 for it to work. What version is reported if you enter `python --version` at the command prompt? – Ralf Mar 19 '16 at 10:24
  • >python Python 2.4.3 (#1, Oct 23 2012, 22:02:41) [GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] – Sushil Mar 21 '16 at 19:58

1 Answers1

1

You need to install python 2.7. Probably in parallel to your system installation so not to break your Linux distribution. For Centos 6.5 the instructions here worked like a charm for me. As Centos is a Redhat clone it should work for you as well.

  1. Install dependencies
  2. Download the python 2.7 sources.
  3. Configure and build python; note that you have to make altinstall so not to mess with your system installation of python!
  4. Verify the installation: try python2.7 --version, if everything worked out OK this will print the version info of your python 2.7 installation

Then edit the cqlsh shell script. It contains just one code line. At the start of that line replace python with python2.7, save the file, and now you should be able to run cqlsh.

Community
  • 1
  • 1
Ralf
  • 6,735
  • 3
  • 16
  • 32