0

I am trying to install py2neo on a CentOS server. It fails with the following message:

File "setup.py", line 29, in <module>
from py2neo import __author__, __email__, __license__, __package__, __version__
File "/root/Downloads/py2neo-2.0/py2neo/__init__.py", line 27, in <module>
from py2neo.core import *
File "/root/Downloads/py2neo-2.0/py2neo/core.py", line 1313
new_inst.__stale.update({"labels", "properties"})
                                 ^
SyntaxError: invalid syntax 

This happens whether I am using pip install py2neo or I install manually after downloaded the module. When I try the same command on a MacBook everything goes well.

Can someone assist me?

Patrick
  • 1,091
  • 1
  • 14
  • 14
  • 1
    Hi there @patrick - unfortunately you seem to have landed on the wrong site :( [so] is for programming related questions where your post is more closely related to administration of a server. Perhaps [su] or [sf] would be better suited to your question. – Lix Feb 26 '15 at 13:13
  • What version of CentOS are you using? This sounds like a python version mismatch (the installed version is older than what `py2neo` supports). That appears to be python 2.7 syntax, I think. – Etan Reisner Feb 26 '15 at 14:00

1 Answers1

1

You're probably trying to install under Python 2.6, which doesn't support the literal set syntax and so is expecting a dict instead.

As Etan mentions above, py2neo does not support Python 2.6. You'll have to upgrade to either Python 2.7 or Python 3.

Nigel Small
  • 4,475
  • 1
  • 17
  • 15
  • Thank you Nigel, This solved my problem. I successfully managed to install py2neo after upgrading my version of python to 2.7 – Patrick Feb 28 '15 at 10:02