Friday, April 24, 2015

Fixing Python Related Error While Installing Cassandra

Cassandra requires Python to be installed in your machine. So you might have downloaded and installed latest version of Python 3.x series. But still when you are trying to install setup.py from Cassandra pylib, you are getting errors. I tried to do it in my Windows machine and got error similar to below logs:
    byte-compiling D:\test\software\python\Lib\site-packages\cqlshlib\cqlhandling.py to cqlhandling.cpython-34.pyc

      File "D:\test\software\python\Lib\site-packages\cqlshlib\cqlhandling.py", line 240

        print "cql_complete(%r, partial=%r)" % (text, partial)

                                           ^

    SyntaxError: invalid syntax


    byte-compiling D:\test\software\python\Lib\site-packages\cqlshlib\displaying.py to displaying.cpython-34.pyc

    byte-compiling D:\test\software\python\Lib\site-packages\cqlshlib\formatting.py to formatting.cpython-34.pyc

    byte-compiling D:\test\software\python\Lib\site-packages\cqlshlib\helptopics.py to helptopics.cpython-34.pyc

      File "D:\test\software\python\Lib\site-packages\cqlshlib\helptopics.py", line 27

        print "\n        CQL types recognized by this version of cqlsh:\n"

                                                                         ^

    SyntaxError: Missing parentheses in call to 'print'


    byte-compiling D:\test\software\python\Lib\site-packages\cqlshlib\meter.py to meter.cpython-34.pyc

      File "D:\test\software\python\Lib\site-packages\cqlshlib\meter.py", line 57

        print ""

               ^

    SyntaxError: Missing parentheses in call to 'print'


    byte-compiling D:\test\software\python\Lib\site-packages\cqlshlib\pylexotron.py to pylexotron.cpython-34.pyc

      File "D:\test\software\python\Lib\site-packages\cqlshlib\pylexotron.py", line 131

        print "Trying completer %r with %r" % (completer, ctxt)

                                          ^

    SyntaxError: invalid syntax


    byte-compiling D:\test\software\python\Lib\site-packages\cqlshlib\saferscanner.py to saferscanner.cpython-34.pyc

    byte-compiling D:\test\software\python\Lib\site-packages\cqlshlib\sslhandling.py to sslhandling.cpython-34.pyc

    byte-compiling D:\test\software\python\Lib\site-packages\cqlshlib\tracing.py to tracing.cpython-34.pyc

    byte-compiling D:\test\software\python\Lib\site-packages\cqlshlib\util.py to util.cpython-34.pyc

    byte-compiling D:\test\software\python\Lib\site-packages\cqlshlib\wcwidth.py to wcwidth.cpython-34.pyc

      File "D:\test\software\python\Lib\site-packages\cqlshlib\wcwidth.py", line 367

        print 'tests pass.'

                          ^

    SyntaxError: Missing parentheses in call to 'print'


    byte-compiling D:\test\software\python\Lib\site-packages\cqlshlib\__init__.py to __init__.cpython-34.pyc

    running install_egg_info

    Writing D:\test\software\python\Lib\site-packages\cassandra_pylib-0.0.0-py3.4.egg-info
This is because Cassandra supports Python 2.x series. So uninstall Python 3 from your machine and install latest version of Python 2. Then try to run "python setup.py install" command again. It should run just fine without any errors.

No comments:

Post a Comment