HIPS / Spearmint

Spearmint Bayesian optimization codebase
Other
1.55k stars 329 forks source link

print sys.exc_info() SyntaxError: invalid syntax #10

Closed enedene closed 9 years ago

enedene commented 9 years ago

I'm trying to run the noisy example on Arch Linux. Python 3 is default on Arch, so to run python 2, you need to run it with the command python2 . So here is what I do:

python2 main.py /home/ed/Spearmint/examples/noisy/

I get this SyntaxError:

File "/usr/lib/python2.7/site-packages/spearmint-0.1-py2.7.egg/spearmint/launcher.py", line 274
print sys.exc_info()
        ^
SyntaxError: invalid syntax

I thought that at some point script was trying to run python scrpits with python command which would use python 3, so print without brackets wouldn't work. Changing the line to:

print (sys.exc_info())

doesn't fix the problem, so it must be something else.

JasperSnoek commented 9 years ago

Hi enedene, I had a similar problem running this on CentOS, which has a version of python installed essentially as a system tool for the OS. I worked around it using anaconda (http://continuum.io/downloads). Anaconda creates a little virtual environment when you use the 'activate' command that aliases the desired python version as the 'python' command. Could you try installing anaconda's version of python2.7 and then running?

enedene commented 9 years ago

Hi Jasper, in the meantime I was able to get it running by not running setup.py, but setting up paths for the spearmint directly. But thanks for Anaconda suggestion, it would have made things easier.