Concurrence系列-安裝

 

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)  

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章