How to avoid compilation ?

#1

Hello,

I tried to install crossbar with asyncio on python3.4 doing :

pip install crossbar[asynci]

But it failed, trying to find python.h. After install the python headers (python-dev package on my machine), it went fine.

But right after that, trying to run the crossbar command will crash because of print not having parenthesis :

File “/home/michel/.virtualenvs/thehandler/local/lib/python3.4/site-packages/crossbar/cli.py”, line 93
print “Crossbar.io software versions:”
^
SyntaxError: invalid syntax

So first, since I’m not using twisted (which it seemed to have installed anyway, this is strange and causes non crashing errors while running setup.py) but the stdlib event loop and I don’t plan to use ssl, why does it require C extensions at all ?

Is there a way to install it without compiling anything ?

I remember that Django was very appealing at the time because you could just drop the entire framework folder in your project root and it would work as-is. It still does.

Is it possible to do something like that with crossbar ?

For dev, I don’t need C accelerated versions of the critical modules, and if I want to show off to friends and tell them it’s awesome, I don’t want to scare them with this issue.

Secondly, is there something specific to be done to be able to install crossbar on Python 3.4 ?

I installed it with twisted on python 2 and ran some demos fine, but I’l like to start the new project with Python 3.

0 Likes

#2

Hello,

I tried to install crossbar with asyncio on python3.4 doing :

pip install crossbar[asynci]

Won't do what you expect;(

The ultra-short version (I add doc issues to make all this more clear):

AutobahnPython supports Py 2/3 both asyncio/Twisted for _WebSocket_, but not (yet) WAMP.

AutobahnPython _will_ support Py2/3 asyncio for WAMP for writing app components.

Twisted has limited support for Python 3 (e.g. some things work .. such as AutobahnPython WebSocket TCP .. others not yet).

Crossbar is more bound to Twisted: we use a lot of stuff that comes with Twisted out of the box, but where there is no counterpart in asyncio. Twisted is a lot more comprehensive (read: scope).

But: you should be able to write and run _app components_ written against asyncio under Crossbar - once we have support for WAMP/asyncio in AutobahnPython.

Means: run the WAMP/asyncio app component in "component.python" worker process .. which will totally run only asyncio inside.

But it failed, trying to find python.h. After install the python headers
(python-dev package on my machine), it went fine.

But right after that, trying to run the crossbar command will crash
because of print not having parenthesis :

   File
"/home/michel/.virtualenvs/thehandler/local/lib/python3.4/site-packages/crossbar/cli.py",
line 93
     print "Crossbar.io software versions:"
                                          ^
SyntaxError: invalid syntax

That's a bug .. in fact there will be more of those still.

Crossbar should run on Python 3 / Twisted ..

So first, since I'm not using twisted (which it seemed to have installed
anyway, this is strange and causes non crashing errors while running
setup.py) but the stdlib event loop and I don't plan to use ssl, why
does it require C extensions at all ?

Is there a way to install it without compiling anything ?

This is a very good point .. we'll do that:

https://github.com/crossbario/crossbar/issues/40

The current install dependencies list

install_requires = ['setuptools>=2.2',
                     'twisted>=twisted-13.2',
                     'autobahn[twisted]>=0.8.6',
                     'cryptography>=0.2.1',
                     'pyOpenSSL>=0.14',
                     'psutil>=1.2.1',
                     'msgpack-python>=0.4.1',
                     'jinja2>=2.7.2']

Only the first 3 are essential (we cannot do without).

But: Twisted will compile some little (and non essential) thing itself. I remember there is an issue for that in Twisted also .. remove that requirement .. make Twisted "Python bytecode" only ..

I remember that Django was very appealing at the time because you could
just drop the entire framework folder in your project root and it would
work as-is. It still does.

Is it possible to do something like that with crossbar ?

For dev, I don't need C accelerated versions of the critical modules,
and if I want to show off to friends and tell them it's awesome, I don't
want to scare them with this issue.

Spreading is awesome! Thanks.

I totally agree the developer experience should be as easy and issue-free as possible.

We are working on this. Are your friends on Windows or OSX or other? We can then test better the dev. experience ..

I am used to a lot of potential issues and workarounds .. so I forgot about "first dev experience".

E.g. Linux makes everything an absolute snap .. up to compiling "world" from scratch. But I am not a "linux only" fanboy .. want to make sure anyone has a great experience no matter what OS. Leaving aside some obscure ones;)

Secondly, is there something specific to be done to be able to install
crossbar on Python 3.4 ?

We need to fix Python 3 syntax issues in Crossbar. I make that high prio:

https://github.com/crossbario/crossbar/issues/41

Note that you _will_ need Twisted (for Crossbar itself). No way around.

I installed it with twisted on python 2 and ran some demos fine, but I'l
like to start the new project with Python 3.

Understood.

Btw: you can also try

pip install crossbardemo
crossbar init --template demos
crossbar start

which will ramp up some nice demos automatically ..

···

Am 24.03.2014 01:50, schrieb Michel Desmoulin:

--
You received this message because you are subscribed to the Google
Groups "Autobahn" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to autobahnws+...@googlegroups.com
<mailto:autobahnws+...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.

0 Likes

#3

Thank you so much for the detailed answer.

It’s true it’s easy to forget how hard compilation is on windows and to a lesser extend, to mac (for wich you need xcode…).

But I don’t want to pressure you with a thousand issues to resolve, nothing I’m talking about is an emergency. It’s a huge project so I’m already quite surprise you manage to be that reactive on the mailing list.

···

On Monday, March 24, 2014 1:50:57 AM UTC+1, Michel Desmoulin wrote:

Hello,

I tried to install crossbar with asyncio on python3.4 doing :

pip install crossbar[asynci]

But it failed, trying to find python.h. After install the python headers (python-dev package on my machine), it went fine.

But right after that, trying to run the crossbar command will crash because of print not having parenthesis :

File “/home/michel/.virtualenvs/thehandler/local/lib/python3.4/site-packages/crossbar/cli.py”, line 93
print “Crossbar.io software versions:”
^
SyntaxError: invalid syntax

So first, since I’m not using twisted (which it seemed to have installed anyway, this is strange and causes non crashing errors while running setup.py) but the stdlib event loop and I don’t plan to use ssl, why does it require C extensions at all ?

Is there a way to install it without compiling anything ?

I remember that Django was very appealing at the time because you could just drop the entire framework folder in your project root and it would work as-is. It still does.

Is it possible to do something like that with crossbar ?

For dev, I don’t need C accelerated versions of the critical modules, and if I want to show off to friends and tell them it’s awesome, I don’t want to scare them with this issue.

Secondly, is there something specific to be done to be able to install crossbar on Python 3.4 ?

I installed it with twisted on python 2 and ran some demos fine, but I’l like to start the new project with Python 3.

0 Likes