AutobahnPython on Jython

85 views
Skip to first unread message

Tobias Oberstein

unread,
Mar 8, 2013, 3:32:10 PM3/8/13
to autobahnws
Hi,

get AutobahnPython running on Jython .. pls see

http://twistedmatrix.com/trac/ticket/3413#comment:21

and the AutobahnPython project's README.

I tested a server using AutobahnTestsuite .. it passes everything
(though a few non-strict cases that are timing/reactor related).

Don't hold your breath .. it's a little slower than CPython.

But running AutobahnPython under Jython might come handy for some
situations ..

- Tobias

Alejandro Hernandez

unread,
May 2, 2013, 12:45:54 PM5/2/13
to autob...@googlegroups.com
Great!, actually this could help me a lot, since I'm trying to avoid the CPython GIL in order to leverage on multiple cores with a heavily threaded environment, and I'm using twisted not only for autobahn but the whole server.

Thanks!.

Alejandro Hernandez

unread,
May 2, 2013, 1:14:03 PM5/2/13
to autob...@googlegroups.com
I'm trying to reproduce your installation, using Jython 2.7b1, and I already did the patches you suggested. But I'm having trouble with other things, I'm getting a module not found:
>>> import twisted
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/twisted/__init__.py", line 53, in <module>
    _checkRequirements()
  File "/usr/local/lib/python2.7/dist-packages/twisted/__init__.py", line 37, in _checkRequirements
    raise ImportError(required + ": no module named zope.interface.")
ImportError: Twisted requires zope.interface 3.6.0 or later: no module named zope.interface.

But module is there, zope is installed (right next to twisted in the directory) and its version is 4.0.5.
And I'm able to
Did you had this problem? any Idea on how to fix it?.

Regards,

Alejandro Hernandez

unread,
May 2, 2013, 1:15:10 PM5/2/13
to autob...@googlegroups.com


On Thursday, May 2, 2013 12:44:03 PM UTC-4:30, Alejandro Hernandez wrote:
I'm trying to reproduce your installation, using Jython 2.7b1, and I already did the patches you suggested. But I'm having trouble with other things, I'm getting a module not found:
>>> import twisted
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/twisted/__init__.py", line 53, in <module>
    _checkRequirements()
  File "/usr/local/lib/python2.7/dist-packages/twisted/__init__.py", line 37, in _checkRequirements
    raise ImportError(required + ": no module named zope.interface.")
ImportError: Twisted requires zope.interface 3.6.0 or later: no module named zope.interface.

But module is there, zope is installed (right next to twisted in the directory) and its version is 4.0.5.
And I'm able to
And I'm able to import the module zope "isolated". 

Tobias Oberstein

unread,
May 2, 2013, 2:21:37 PM5/2/13
to autob...@googlegroups.com, Alejandro Hernandez
Am 02.05.2013 18:45, schrieb Alejandro Hernandez:
> Great!, actually this could help me a lot, since I'm trying to avoid the
> CPython GIL in order to leverage on multiple cores with a heavily
> threaded environment, and I'm using twisted not only for autobahn but
> the whole server.

Just saying, for Autobahn (WAMP or WebSocket) _itself_:

Don't expect any performance gains from Jython (to the contrary). For
example, Jython only exposes Posix select, not epoll or kqueue or IOCP.
If you want performance, try PyPy ..

>
> Thanks!.
>
> On Friday, March 8, 2013 4:02:10 PM UTC-4:30, Tobias Oberstein wrote:
>
> Hi,
>
> get AutobahnPython running on Jython .. pls see
>
> http://twistedmatrix.com/trac/ticket/3413#comment:21
> <http://twistedmatrix.com/trac/ticket/3413#comment:21>
>
> and the AutobahnPython project's README.
>
> I tested a server using AutobahnTestsuite .. it passes everything
> (though a few non-strict cases that are timing/reactor related).
>
> Don't hold your breath .. it's a little slower than CPython.
>
> But running AutobahnPython under Jython might come handy for some
> situations ..
>
> - Tobias
>
> --
> 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.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Tobias Oberstein

unread,
May 2, 2013, 2:23:07 PM5/2/13
to autob...@googlegroups.com, Alejandro Hernandez
Am 02.05.2013 19:14, schrieb Alejandro Hernandez:
> I'm trying to reproduce your installation, using Jython 2.7b1, and I
> already did the patches you suggested. But I'm having trouble with other
> things, I'm getting a module not found:
> >>> import twisted
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "/usr/local/lib/python2.7/dist-packages/twisted/__init__.py",
> line 53, in <module>
> _checkRequirements()
> File "/usr/local/lib/python2.7/dist-packages/twisted/__init__.py",
> line 37, in _checkRequirements
> raise ImportError(required + ": no module named zope.interface.")
> ImportError: Twisted requires zope.interface 3.6.0 or later: no module
> named zope.interface.
>
> But module is there, zope is installed (right next to twisted in the
> directory) and its version is 4.0.5.
> And I'm able to
> Did you had this problem? any Idea on how to fix it?.

No, I did not have issues with that. Are you sure you installed Twisted
and zope.interface into the Jython site-packages?

Since above traceback refers to

/usr/local/lib/python2.7/dist-packages/

..


>
> Regards,
>
> On Thursday, May 2, 2013 12:15:54 PM UTC-4:30, Alejandro Hernandez wrote:
>
> Great!, actually this could help me a lot, since I'm trying to avoid
> the CPython GIL in order to leverage on multiple cores with a
> heavily threaded environment, and I'm using twisted not only for
> autobahn but the whole server.
>
> Thanks!.
>
> On Friday, March 8, 2013 4:02:10 PM UTC-4:30, Tobias Oberstein wrote:
>
> Hi,
>
> get AutobahnPython running on Jython .. pls see
>
> http://twistedmatrix.com/trac/ticket/3413#comment:21
> <http://twistedmatrix.com/trac/ticket/3413#comment:21>
>
> and the AutobahnPython project's README.
>
> I tested a server using AutobahnTestsuite .. it passes everything
> (though a few non-strict cases that are timing/reactor related).
>
> Don't hold your breath .. it's a little slower than CPython.
>
> But running AutobahnPython under Jython might come handy for some
> situations ..
>
> - Tobias
>

Alejandro Hernandez

unread,
May 2, 2013, 3:12:24 PM5/2/13
to autob...@googlegroups.com, Alejandro Hernandez


On Thursday, May 2, 2013 1:53:07 PM UTC-4:30, Tobias Oberstein wrote:
Am 02.05.2013 19:14, schrieb Alejandro Hernandez:
> I'm trying to reproduce your installation, using Jython 2.7b1, and I
> already did the patches you suggested. But I'm having trouble with other
> things, I'm getting a module not found:
>  >>> import twisted
> Traceback (most recent call last):
>    File "<stdin>", line 1, in <module>
>    File "/usr/local/lib/python2.7/dist-packages/twisted/__init__.py",
> line 53, in <module>
>      _checkRequirements()
>    File "/usr/local/lib/python2.7/dist-packages/twisted/__init__.py",
> line 37, in _checkRequirements
>      raise ImportError(required + ": no module named zope.interface.")
> ImportError: Twisted requires zope.interface 3.6.0 or later: no module
> named zope.interface.
>
> But module is there, zope is installed (right next to twisted in the
> directory) and its version is 4.0.5.
> And I'm able to
> Did you had this problem? any Idea on how to fix it?.

No, I did not have issues with that. Are you sure you installed Twisted
and zope.interface into the Jython site-packages?

Since above traceback refers to

/usr/local/lib/python2.7/dist-packages/

Yup, you're right, I haven't, I just added the dist-packages of my current python installation to the sys.path in Jython.
I will install it inside Jython instead and try.
Reply all
Reply to author
Forward
0 new messages