2011-02-01

How to run Syncless on Linux without installing it?

This blog post explains how to run asynchronous, coroutine-based client and server I/O libraries like Syncless, gevent and Concurrence on Linux without installing them.

On Linux, it's possible to try Syncless without installation, using the StaticPython binary Python distribution, like this:

$ wget -O stacklessco2.7-static \
  https://raw.githubusercontent.com/pts/staticpython/master/release/stacklessco2.7-static
$ chmod +x stacklessco2.7-static
$ ./stacklessco2.7-static
Python 2.7.1 Stackless 3.1b3 060516 (release27-maint, Feb  1 2011, 16:57:16)
[GCC 4.1.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from syncless import coio
>>> coio.sleep(1.5)
(sleeping for 1.5 second)
<object object at 0xf7709490>
>>>

Limitations:

  • This solution requires Linux on x86 (i386) or x86_64 (amd64) architecture. If you have a different Unix system, you have to install Syncless the regular way (e.g. with sudo easy_install syncless).
  • This solution doesn't give you the newest version of Syncless.
  • You can't use Python extensions written in C, except for those compiled into stacklessco2.7-static. See the full list on the StaticPython home page.

Please note that StaticPython can run many other I/O frameworks and libraries, which don't require compiling C extensions. Such libraries include Eventlet, Tornado, Twisted, asyncore and circuits.

No comments: