crossbario / crossbar

Crossbar.io - WAMP application router
https://crossbar.io/
Other
2.05k stars 274 forks source link

Crossbar installation error SyntaxError: invalid syntax #961

Closed alexey2baranov closed 7 years ago

alexey2baranov commented 7 years ago

Hello!

i try to install crossbar on my Ubuntu server with Python 2.7.6 sudo pip install crossbar

and get this error. what should i do?

Installing collected packages: crossbar, netaddr, sdnotify, incremental, setuptools, autobahn, watchdog, attrs, service-identity, PyYAML, lmdb, treq, Pygments, mistune, setproctitle, u-msgpack-python, cryptography, PyNaCl, cbor, pyqrcode, PyTrie, zope.interface, click, bitstring, pyasn1, Twisted, shutilwhich, pyasn1-modules, constantly, pyOpenSSL, Jinja2, psutil, py-ubjson, appdirs, six, packaging, txaio, argh, pathtools, idna, enum34, ipaddress, cffi, sortedcontainers, MarkupSafe, pyparsing, pycparser Compiling /tmp/pip_build_root/crossbar/crossbar/worker/test/examples/syntaxerror.py ... File "/tmp/pip_build_root/crossbar/crossbar/worker/test/examples/syntaxerror.py", line 33 class # noqa ^ SyntaxError: invalid syntax

kuema commented 7 years ago

I have just encountered the same issue on a Debian Jessie machine. It was caused by an old version of pip (1.5.6) and setuptools (5.5.1) in my Crossbar's virtualenv.

To fix it, just run pip install -U setuptools pip in your virtualenv and Crossbar should install/update fine.

oberstet commented 7 years ago

Interesting. Never had issues with that. FWIW, the syntaxerror.py is part of the unit tests and deliberately contains a syntax error. It is not supposed to be compiled during installation.

meejah commented 7 years ago

We might be able to put a pip/setuptools version in setup_requires (which is different from install_requires) to at least get a better error-message. I made a quick attempt with "pip>=" and "setuptools>=" in crossbar's setup.py but this just crashes a Debian 1.5.6 pip with a recursion error :/

oberstet commented 7 years ago

FWIW, I don't care about Debian system Python/pip. People should NOT use that. It is explicitly unsupported (in as, I won't spend 1 minute trying to work around Debian distro Python/pip)

kuema commented 7 years ago

I don't care about the system version either, but that version of pip is exactly what you get, if you follow the instructions in your documentation (section "Setup for CPython"). It is not stated that it's unsupported either, it explicitly says to apt-get install python-pip as one of its requirements.

I agree that a workaround is unnecessary, but maybe you could extend that doc section with an update step for pip/setuptools (pip install -U setuptools pip) after creating the virtualenv. That would be a very helpful hint for new users because it took some time to find the root cause of this problem from the error messages you get.

goeddea commented 7 years ago

@kuema - You're right about the documentation. I've filed an issue https://github.com/crossbario/crossbar/issues/996 for this.