Getting invalid syntax error when i try to start yugabytes DB - yugabytedb

I have installed yugabytes DB in linux machine and when i try to start the cluster using yugabyted and getting error as invalid syntax. Please help how to resolve this issue.
./bin/yugabyted status
File "./bin/yugabyted", line 1430
with open(out_log, "a") as out_log, open(err_log, "a") as err_log:
^
SyntaxError: invalid syntax
Python version using - 2.6.6
Linux Version - 2.6.32-754.31.1.el6.x86_64

This is a Python 2.6 issue where multiple contextmanagers in the same line are not supported - https://docs.python.org/2.7/reference/compound_stmts.html#the-with-statement. While the fix for this particular error should be simple, Python 2.6 is quite outdated at this point - retired in 2013 according to https://www.python.org/downloads/release/python-269/ - and I would recommend upgrading to Python 2.7.

Related

Unable to launch cqlsh in datastax Cassandra distribution

I have donwloaded ddac-5.1.17, and can successfully launch cassandra server.
But on executing 'cqlsh' command from command line in Windows 10, I get strange error:
\ddac-5.1.17\bin>cqlsh
File "....\ddac-5.1.17\bin\cqlsh.py", line 152
except ImportError, e:
SyntaxError: invalid syntax
What's wrong here?
Use python 2.7,
You can find detail here
https://issues.apache.org/jira/browse/CASSANDRA-10190
I hope this helps !

OpenOPC with Python 3.6

I am having some problems in making OpenOPC to work with Python 3.6. The environment I am working in is a Windows 2012 Server. I have installed Matrikon OPC Server to test. I have both Python 2.7 and 3.6 installed through the packages Anaconda 2 and Anaconda 3. In Python 2.7 it is working fine. For Python 3.6 I installed following the instructions in this site https://pypi.org/project/OpenOPC-Python3x/. When I try to creat a open_client to the localhost
opc = OpenOPC.open_client('localhost')
I receive the following error message:
File "C:\ProgramData\Anaconda3\lib\site-packages\Pyro4\message.py",
line 152, in from_header raise errors.ProtocolError("invalid data or
unsupported protocol version") ProtocolError: invalid data or
unsupported protocol version
It seems that there is a compatibility problem with the Pyro4 package. Currently it is in the release 4.73. The miminun version requeired by the OpenOPC package is 4.61. I tried to install this version but it didn't work also.
Does any one have seen a similar problem?
I have found the problem. I was using the openOPCService from Python 2.7. After I installed the correct version It start working. At least partially.

string: syntax error on raspbian jelly, flawless on IDLE windows 8

My script (python 3.6) raises an error when executed on my RPI (Linux raspberrypi 4.9.59-v7+ #1047), but runs flawlessly when executed with IDLE, on a windows 8.1 PC.
Basically, I want to create a gzip archive from "data.json" file.
Here is a light version:
import time
import gzip
inputFile = "/path/to/data.json"
dataArchiveName = f"{inputFile}-{time.localtime().tm_mday}_{time.localtime().tm_mon}_{time.localtime().tm_year}.gz"
...
When I run the script, the following exception is raised:
File "dataManager2.py", line 96
dataArchiveName = f"{inputFile}-{time.localtime().tm_mday}_{time.localtime().tm_mon}_{time.localtime().tm_year}.gz"
^
SyntaxError: invalid syntax
I do not understand why... Any idea ?
Thank you in advance
f-strings were introduced in Python 3.6, since you are using Python 3.5 on you Raspberry Pi, you will have to either install Python 3.6 on it or use older way of formatting strings, this should work:
dataArchiveName = "%s-%s_%s_%s.gz" % (inputFile, time.localtime().tm_mday, time.localtime().tm_mon, time.localtime().tm_year)

Syntax error resulting from builtin functions in Python33.exe

I'm quite new to python and I just installed python 3.3.2 in my Win 8 64bit PC.
I tried typing in several builtin functions and I get a syntax error for all of them
For example:-
>>>print len("parrot")
File "<stdin>", line 1
print len("parrot")
^
SyntaxError: invalid syntax
I uninstalled/reinstalled python several times and added the path variable automatically during installation as well as manually after installation.
I suspect this might be something related to Win 8 but I'm not sure. Does anyone else have this issue with Python33 on Win8?
Solutions to get python going would be greatly appreciated.
Thanks!
print is now a function
print(len("parrot"))
should work

Getting syntax errors when building with python 3.1 and not with python 2.6

Using Mac os X 10.6, python 3.1 and gcc 4.0 trying to build pyfsevent implemented in python2.6 by converting it to python 3.1.
Wondering when getting the following errors while building in python 3.1 alone.
Why not when building with python 2.6?
error: syntax error before ‘CFFileDescriptorRef’
warning: no semicolon at end of struct or union
error: syntax error before ‘}’ token
warning: data definition has no type or storage class
The C code does not get converted when running 2to3, you need to port it manually.

Resources