现在的位置: 首页 > 综合 > 正文

Concurrence系列-安装

2013年05月05日 ⁄ 综合 ⁄ 共 766字 ⁄ 字号 评论关闭

 

Concurrence的安装还是比较正常的(比那些编译时报出100个error的东西好多了)。

 

我试了两个平台,有奔头(8.x,企业版),和Mac(leopard), 

有奔头下,

 

 

可能需要

apt-get install python-dev

apt-get install libevent-dev

 

 

 

easy_install pyrex

 

 

easy_install concurrence

如果这里遇到错误,说不定可以这样解决:

 

python -c "from Pyrex.Compiler import Scanning;Scanning.get_lexicon()"

然后再easy_install concurrence
顺便说一下:
Pyrex lets you write code that mixes Python and C data types any way you want, and compiles it into a C extension for Python. 

然后:

easy_install greenlet

greenlet 可以... lightweight in-process concurrent programming

 

 

 

此外,可能需要的python包有:

 

easy_install simplejson

 

easy_install routes

easy_install webob

 

 

 

 

 

当然,你可以把concurrence 运行在 stackless上(而不是greenlet)稍微快一点而已,

 

 

Mac下:

几乎一样。

 

 

如果能运行下面的代码,就说明可以了:

 

 

from concurrence import dispatch

 

def hello():

    print "Hello World!"

 

if __name__ == '__main__':

    dispatch(hello)  

 

 

 

抱歉!评论已关闭.