mac linux 下Concurrence的安装记录

本文详细介绍了在不同操作系统上安装Python库setuptools、libevent、stackless等,并配置相应环境,解决安装过程中遇到的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

官网的安装说明http://opensource.hyves.org/concurrence/install.html#install

我们在安装之前,要先安装一个工具

easy_install 
先下载

与python 对应的egg

FileTypePy VersionUploaded onSize# downloads
setuptools-0.6c11-1.src.rpm (md5
built for redhat 4.3
RPMany2009-10-20263KB20074
setuptools-0.6c11-py2.3.egg (md5)Python Egg2.32009-10-201MB11531
setuptools-0.6c11-py2.4.egg (md5)Python Egg2.42009-10-20329KB184646
setuptools-0.6c11-py2.5.egg (md5)Python Egg2.52009-10-20325KB441868
setuptools-0.6c11-py2.6.egg (md5)Python Egg2.62009-10-20325KB716193
setuptools-0.6c11-py2.7.egg (md5)Python Egg2.72010-07-08324KB412558
setuptools-0.6c11.tar.gz (md5)Source 2009-10-20250KB194660
setuptools-0.6c11.win32-py2.3.exe (md5)MS Windows installer2.32009-10-20218KB7380
setuptools-0.6c11.win32-py2.4.exe (md5)MS Windows installer2.42009-10-20222KB6134
setuptools-0.6c11.win32-py2.5.exe (md5)MS Windows installer2.52009-10-20222KB40554
setuptools-0.6c11.win32-py2.6.exe (md5)MS Windows installer2.62009-10-20222KB120261
setuptools-0.6c11.win32-py2.7.exe (md5)MS Windows installer2.72010-07-08222KB91244
再运行

sh setuptools-0.6c9-py2.4.egg --prefix=~
我在安装过程中,这一command出错,

hmatoMacBook-Air:Downloads h$ sh setuptools-0.6c11-py2.6.egg --prefix=~error: can't create or remove files in install directory


The following error occurred while trying to add or remove files in the
installation directory:


    [Errno 2] No such file or directory: '/Users/h/lib/python2.6/site-packages/test-easy-install-743.pth'


The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:


    /Users/h/lib/python2.6/site-packages


This directory does not currently exist.  Please create it and try again, or
choose a different installation directory (using the -d or --install-dir
option).


hmatoMacBook-Air:Downloads h$ sudo sh setuptools-0.6c11-py2.6.egg --prefix=~
Password:

我是系统中已经有python 担它打不到,,打错地方了,  /Users/h/lib/python2.6/site-packages

把command 改成去到〜

sh setuptools-0.6c9-py2.4.egg --prefix=


下载到的egg文件要改名,,把后面的sh去了不然会出错的

hmatoMacBook-Air:Downloads h$ mv setuptools-0.6c11-py2.6.egg.sh setuptools-0.6c11-py2.6.egg



再运行

easy_install pyrex
下面的command会出错
easy_install concurrence
提示有 SandboxViolation: ... 出错时

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

还会出现在这样的error


sudo easy_install concurrenceSearching for concurrence
Reading http://pypi.python.org/simple/concurrence/
Reading http://opensource.hyves.org/concurrence
Best match: concurrence 0.3.1
Downloading http://concurrence.googlecode.com/files/concurrence-0.3.1.tar.gz
Processing concurrence-0.3.1.tar.gz
Running concurrence-0.3.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-BcTww6/concurrence-0.3.1/egg-dist-tmp-R5IGSU
lib/concurrence/concurrence._event.c:32:19: error: event.h: No such file or directory
lib/concurrence/concurrence._event.c:68: error: field ‘ev’ has incomplete type
lib/concurrence/concurrence._event.c: In function ‘__pyx_f_11concurrence_6_event_5event___init__’:
lib/concurrence/concurrence._event.c:301: warning: implicit declaration of function ‘evtimer_set’
lib/concurrence/concurrence._event.c:322: warning: implicit declaration of function ‘event_set’
lib/concurrence/concurrence._event.c: In function ‘__pyx_f_11concurrence_6_event_5event_add’:
lib/concurrence/concurrence._event.c:436: warning: implicit declaration of function ‘event_add’
lib/concurrence/concurrence._event.c: In function ‘__pyx_f_11concurrence_6_event_5event_pending’:
lib/concurrence/concurrence._event.c:517: warning: implicit declaration of function ‘event_pending’
lib/concurrence/concurrence._event.c: In function ‘__pyx_f_11concurrence_6_event_5event_delete’:
lib/concurrence/concurrence._event.c:554: warning: implicit declaration of function ‘event_del’


这里有需要安装一下

libevent-dev
linux 下就直接

apt-get install python-dev
apt-get install libevent-dev
python-dev 一般都有,,出错了,就要安装,,我是没出错,就没有安装了,自己带了吧

我现在用的是mac 

先去http://mac.softpedia.com/progDownload/libevent-Download-47611.html 下载一个

libevent 2.0.11: Free Download

安装方法
先解压
hmatoMacBook-Air:libevent-2.0.11-stable h$ ./configure 
hmatoMacBook-Air:libevent-2.0.11-stable h$ make 
hmatoMacBook-Air:libevent-2.0.11-stable h$ sudo make install

最后一步就是
运行
easy_install greenlet

这样,都 安装完成了

当然,还有一个东西可以安装,,全是优化用的

stackless

www.stackless.com. 下载一个包,安装一下就行了
UBUNTU:
        ./configure --prefix=/opt/stackless --with-readline --with-zlib=/usr/include
        make
        make install

OSX (Leopard):
        ./configure --prefix=/opt/stackless --enable-framework --enable-stacklessfewerregisters --with-readline --with-zlib=/usr/include
        echo '#define SETPGRP_HAVE_ARG' >> pyconfig.h
        make
        make install
上面的command 不一定用的到,,我mac 下是下载了一个
dmg包 进行安装的

安装好后
运行

ln -s /opt/stackless/bin/python2.5 /usr/bin/stackless

这样就可以了

有可以你会找到不 /opt/stackless/bin/python2.5

你查一下,你的python2.5放在那里,,,把前面的path改了就行,,我不知道这个连接干 什么用,有人说,不要ln也行!知道的朋友可以告诉我一下,让我也知道







FileTypePy VersionUploaded onSize# downloads
setuptools-0.6c11-1.src.rpm (md5
built for redhat 4.3
RPMany2009-10-20263KB20074
setuptools-0.6c11-py2.3.egg (md5)Python Egg2.32009-10-201MB11531
setuptools-0.6c11-py2.4.egg (md5)Python Egg2.42009-10-20329KB184646
setuptools-0.6c11-py2.5.egg (md5)Python Egg2.52009-10-20325KB441868
setuptools-0.6c11-py2.6.egg (md5)Python Egg2.62009-10-20325KB716193
setuptools-0.6c11-py2.7.egg (md5)Python Egg2.72010-07-08324KB412558
setuptools-0.6c11.tar.gz (md5)Source 2009-10-20250KB194660
FileTypePy VersionUploaded onSize# downloads
setuptools-0.6c11-1.src.rpm (md5
built for redhat 4.3
RPMany2009-10-20263KB20074
setuptools-0.6c11-py2.3.egg (md5)Python Egg2.32009-10-201MB11531
setuptools-0.6c11-py2.4.egg (md5)Python Egg2.42009-10-20329KB184646
setuptools-0.6c11-py2.5.egg (md5)Python Egg2.52009-10-20325KB441868
setuptools-0.6c11-py2.6.egg (md5)Python Egg2.62009-10-20325KB716193
setuptools-0.6c11-py2.7.egg (md5)Python Egg2.72010-07-08324KB412558
setuptools-0.6c11.tar.gz (md5)Source 2009-10-20250KB194660
FileTypePy VersionUploaded onSize# downloads
setuptools-0.6c11-1.src.rpm (md5
built for redhat 4.3
RPMany2009-10-20263KB20074
setuptools-0.6c11-py2.3.egg (md5)Python Egg2.32009-10-201MB11531
setuptools-0.6c11-py2.4.egg (md5)Python Egg2.42009-10-20329KB184646
setuptools-0.6c11-py2.5.egg (md5)Python Egg2.52009-10-20325KB441868
setuptools-0.6c11-py2.6.egg (md5)Python Egg2.62009-10-20325KB716193
setuptools-0.6c11-py2.7.egg (md5)Python Egg2.72010-07-08324KB412558
setuptools-0.6c11.tar.gz (md5)Source 2009-10-20250KB194660
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值