Getting invalid syntax error


#1

Hi all.

I’m trying to run the run the train_cartpole example but I’m getting an invalid syntax error:

python -m baselines.deepq.experiments.train_cartpole
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 163, in _run_module_as_main
mod_name, _Error)
File “/usr/lib/python2.7/runpy.py”, line 102, in _get_module_details
loader = get_loader(mod_name)
File “/usr/lib/python2.7/pkgutil.py”, line 464, in get_loader
return find_loader(fullname)
File “/usr/lib/python2.7/pkgutil.py”, line 474, in find_loader
for importer in iter_importers(fullname):
File “/usr/lib/python2.7/pkgutil.py”, line 430, in iter_importers
import(pkg)
File “/usr/local/lib/python2.7/dist-packages/baselines/deepq/init.py”, line 4, in
from baselines.deepq.simple import learn, load # noqa
File “/usr/local/lib/python2.7/dist-packages/baselines/deepq/simple.py”, line 10, in
from baselines import logger
File “/usr/local/lib/python2.7/dist-packages/baselines/logger.py”, line 139
def log(*args, level=INFO):
^
SyntaxError: invalid syntax

Could somebody give me a hint please?

Best regards.


#2

The problem was related to the python’s version, after using python 3 instead of python everything worked fine.