Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cassandra: "cqlsh" line 145 except ImportError, e: ^ SyntaxError: invalid syntax

Installed cassandra 3.11.1 version in Windows 10 with jdk 1.8.0_151 and python 3.6. All paths available in environment variables. When I run cqlsh in command prompt, I get the below error:

File "C:\Cassandra\bin\\cqlsh.py", line 145
    except ImportError, e:
                      ^
SyntaxError: invalid syntax

Anyone, Any luck with the above error?

like image 456
Vaibhav Gupta Avatar asked Jan 12 '18 03:01

Vaibhav Gupta


3 Answers

cqlsh requires a Python 2 interpreter. See https://issues.apache.org/jira/browse/CASSANDRA-10190

like image 107
kermatt Avatar answered Oct 20 '22 23:10

kermatt


I had the same problem.I downgrade python to 2.7 and it works for me.

ERROR:

cqlsh.py", line 146 except ImportError, e: ^ SyntaxError: invalid syntax

like image 8
Priyanshu Singh Avatar answered Oct 20 '22 23:10

Priyanshu Singh


Ref: https://docs.python.org/3.6/tutorial/errors.html

The error is correct as your syntax is wrong. It should be:

except ImportError as e:
like image 1
Simon Fontana Oscarsson Avatar answered Oct 21 '22 01:10

Simon Fontana Oscarsson