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 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)