20130204ubuntu下安装,python-gevent

来源:互联网 发布:上海传智播客电话知乎 编辑:程序博客网 时间:2024/06/06 07:40
sudo apt-get install libevent-dev
sudo apt-get install python-all-dev
sudo apt-get install python-setuptools
sudo easy_install greenlet

sudo easy_install gevent

卸载

sudo easy_install -mgevent


xx@xx-laptop:~$ sudo easy_install -m gevent
[sudo] password for xx:
Searching for gevent
Best match: gevent 0.13.8
Processing gevent-0.13.8-py2.6-linux-x86_64.egg
Removing gevent 0.13.8 from easy-install.pth file

Using /usr/local/lib/python2.6/dist-packages/gevent-0.13.8-py2.6-linux-x86_64.egg

Because this distribution was installed --multi-version, before you can
import modules from this package in an application, you will need to
'import pkg_resources' and then use a 'require()' call similar to one of
these examples, in order to select the desired version:

    pkg_resources.require("gevent")  # latest installed version
    pkg_resources.require("gevent==0.13.8")  # this exact version
    pkg_resources.require("gevent>=0.13.8")  # this version or higher

Processing dependencies for gevent
Finished processing dependencies for gevent

编译安装

xx@xx-laptop:~/Downloads/gevent-1.0rc2$ sudo python setup.py install
[sudo] password for xx:
running install
running bdist_egg
running egg_info
creating gevent.egg-info
writing requirements to gevent.egg-info/requires.txt
writing gevent.egg-info/PKG-INFO
writing top-level names to gevent.egg-info/top_level.txt
writing dependency_links to gevent.egg-info/dependency_links.txt
writing manifest file 'gevent.egg-info/SOURCES.txt'
reading manifest file 'gevent.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'gevent.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
Linking /home/xx/Downloads/gevent-1.0rc2/build/lib.linux-x86_64-2.6/gevent/core.so to /home/xx/Downloads/gevent-1.0rc2/gevent/core.so
Linking /home/xx/Downloads/gevent-1.0rc2/build/lib.linux-x86_64-2.6/gevent/ares.so to /home/xx/Downloads/gevent-1.0rc2/gevent/ares.so
Linking /home/xx/Downloads/gevent-1.0rc2/build/lib.linux-x86_64-2.6/gevent/_semaphore.so to /home/xx/Downloads/gevent-1.0rc2/gevent/_semaphore.so
Linking /home/xx/Downloads/gevent-1.0rc2/build/lib.linux-x86_64-2.6/gevent/_util.so to /home/xx/Downloads/gevent-1.0rc2/gevent/_util.so
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/gevent
copying build/lib.linux-x86_64-2.6/gevent/resolver_ares.py -> build/bdist.linux-x86_64/egg/gevent
copying build/lib.linux-x86_64-2.6/gevent/event.py -> build/bdist.linux-x86_64/egg/gevent
copying build/lib.linux-x86_64-2.6/gevent/wsgi.py -> build/bdist.linux-x86_64/egg/gevent
copying build/lib.linux-x86_64-2.6/gevent/ares.so -> build/bdist.linux-x86_64/egg/gevent
copying build/lib.linux-x86_64-2.6/gevent/select.py -> build/bdist.linux-x86_64/egg/gevent
copying build/lib.linux-x86_64-2.6/gevent/fileobject.py -> build/bdist.linux-x86_64/egg/gevent
copying build/lib.linux-x86_64-2.6/gevent/queue.py -> build/bdist.linux-x86_64/egg/gevent
copying build/lib.linux-x86_64-2.6/gevent/pywsgi.py -> build/bdist.linux-x86_64/egg/gevent
copying build/lib.linux-x86_64-2.6/gevent/subprocess.py -> build/bdist.linux-x86_64/egg/gevent
copying build/lib.linux-x86_64-2.6/gevent/coros.py -> build/bdist.linux-x86_64/egg/gevent
copying build/lib.linux-x86_64-2.6/gevent/baseserver.py -> build/bdist.linux-x86_64/egg/gevent
copying build/lib.linux-x86_64-2.6/gevent/pool.py -> build/bdist.linux-x86_64/egg/gevent
copying build/lib.linux-x86_64-2.6/gevent/util.py -> build/bdist.linux-x86_64/egg/gevent
copying build/lib.linux-x86_64-2.6/gevent/monkey.py -> build/bdist.linux-x86_64/egg/gevent
copying build/lib.linux-x86_64-2.6/gevent/win32util.py -> build/bdist.linux-x86_64/egg/gevent
copying build/lib.linux-x86_64-2.6/gevent/hub.py -> build/bdist.linux-x86_64/egg/gevent
copying build/lib.linux-x86_64-2.6/gevent/_util.so -> build/bdist.linux-x86_64/egg/gevent
copying build/lib.linux-x86_64-2.6/gevent/core.so -> build/bdist.linux-x86_64/egg/gevent
copying build/lib.linux-x86_64-2.6/gevent/os.py -> build/bdist.linux-x86_64/egg/gevent
copying build/lib.linux-x86_64-2.6/gevent/ssl.py -> build/bdist.linux-x86_64/egg/gevent
copying build/lib.linux-x86_64-2.6/gevent/local.py -> build/bdist.linux-x86_64/egg/gevent
copying build/lib.linux-x86_64-2.6/gevent/resolver_thread.py -> build/bdist.linux-x86_64/egg/gevent
copying build/lib.linux-x86_64-2.6/gevent/threadpool.py -> build/bdist.linux-x86_64/egg/gevent
copying build/lib.linux-x86_64-2.6/gevent/backdoor.py -> build/bdist.linux-x86_64/egg/gevent
copying build/lib.linux-x86_64-2.6/gevent/lock.py -> build/bdist.linux-x86_64/egg/gevent
copying build/lib.linux-x86_64-2.6/gevent/server.py -> build/bdist.linux-x86_64/egg/gevent
copying build/lib.linux-x86_64-2.6/gevent/_semaphore.so -> build/bdist.linux-x86_64/egg/gevent
copying build/lib.linux-x86_64-2.6/gevent/greenlet.py -> build/bdist.linux-x86_64/egg/gevent
copying build/lib.linux-x86_64-2.6/gevent/threading.py -> build/bdist.linux-x86_64/egg/gevent
copying build/lib.linux-x86_64-2.6/gevent/timeout.py -> build/bdist.linux-x86_64/egg/gevent
copying build/lib.linux-x86_64-2.6/gevent/socket.py -> build/bdist.linux-x86_64/egg/gevent
copying build/lib.linux-x86_64-2.6/gevent/__init__.py -> build/bdist.linux-x86_64/egg/gevent
copying build/lib.linux-x86_64-2.6/gevent/_threading.py -> build/bdist.linux-x86_64/egg/gevent
copying build/lib.linux-x86_64-2.6/gevent/thread.py -> build/bdist.linux-x86_64/egg/gevent
byte-compiling build/bdist.linux-x86_64/egg/gevent/resolver_ares.py to resolver_ares.pyc
byte-compiling build/bdist.linux-x86_64/egg/gevent/event.py to event.pyc
byte-compiling build/bdist.linux-x86_64/egg/gevent/wsgi.py to wsgi.pyc
byte-compiling build/bdist.linux-x86_64/egg/gevent/select.py to select.pyc
byte-compiling build/bdist.linux-x86_64/egg/gevent/fileobject.py to fileobject.pyc
byte-compiling build/bdist.linux-x86_64/egg/gevent/queue.py to queue.pyc
byte-compiling build/bdist.linux-x86_64/egg/gevent/pywsgi.py to pywsgi.pyc
byte-compiling build/bdist.linux-x86_64/egg/gevent/subprocess.py to subprocess.pyc
byte-compiling build/bdist.linux-x86_64/egg/gevent/coros.py to coros.pyc
byte-compiling build/bdist.linux-x86_64/egg/gevent/baseserver.py to baseserver.pyc
byte-compiling build/bdist.linux-x86_64/egg/gevent/pool.py to pool.pyc
byte-compiling build/bdist.linux-x86_64/egg/gevent/util.py to util.pyc
byte-compiling build/bdist.linux-x86_64/egg/gevent/monkey.py to monkey.pyc
byte-compiling build/bdist.linux-x86_64/egg/gevent/win32util.py to win32util.pyc
byte-compiling build/bdist.linux-x86_64/egg/gevent/hub.py to hub.pyc
byte-compiling build/bdist.linux-x86_64/egg/gevent/os.py to os.pyc
byte-compiling build/bdist.linux-x86_64/egg/gevent/ssl.py to ssl.pyc
byte-compiling build/bdist.linux-x86_64/egg/gevent/local.py to local.pyc
byte-compiling build/bdist.linux-x86_64/egg/gevent/resolver_thread.py to resolver_thread.pyc
byte-compiling build/bdist.linux-x86_64/egg/gevent/threadpool.py to threadpool.pyc
byte-compiling build/bdist.linux-x86_64/egg/gevent/backdoor.py to backdoor.pyc
byte-compiling build/bdist.linux-x86_64/egg/gevent/lock.py to lock.pyc
byte-compiling build/bdist.linux-x86_64/egg/gevent/server.py to server.pyc
byte-compiling build/bdist.linux-x86_64/egg/gevent/greenlet.py to greenlet.pyc
byte-compiling build/bdist.linux-x86_64/egg/gevent/threading.py to threading.pyc
byte-compiling build/bdist.linux-x86_64/egg/gevent/timeout.py to timeout.pyc
byte-compiling build/bdist.linux-x86_64/egg/gevent/socket.py to socket.pyc
byte-compiling build/bdist.linux-x86_64/egg/gevent/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/gevent/_threading.py to _threading.pyc
byte-compiling build/bdist.linux-x86_64/egg/gevent/thread.py to thread.pyc
creating stub loader for gevent/core.so
creating stub loader for gevent/ares.so
creating stub loader for gevent/_semaphore.so
creating stub loader for gevent/_util.so
byte-compiling build/bdist.linux-x86_64/egg/gevent/core.py to core.pyc
byte-compiling build/bdist.linux-x86_64/egg/gevent/ares.py to ares.pyc
byte-compiling build/bdist.linux-x86_64/egg/gevent/_semaphore.py to _semaphore.pyc
byte-compiling build/bdist.linux-x86_64/egg/gevent/_util.py to _util.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying gevent.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying gevent.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying gevent.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying gevent.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying gevent.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
writing build/bdist.linux-x86_64/egg/EGG-INFO/native_libs.txt
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist/gevent-1.0rc2-py2.6-linux-x86_64.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing gevent-1.0rc2-py2.6-linux-x86_64.egg
creating /usr/local/lib/python2.6/dist-packages/gevent-1.0rc2-py2.6-linux-x86_64.egg
Extracting gevent-1.0rc2-py2.6-linux-x86_64.egg to /usr/local/lib/python2.6/dist-packages
Adding gevent 1.0rc2 to easy-install.pth file


Installed /usr/local/lib/python2.6/dist-packages/gevent-1.0rc2-py2.6-linux-x86_64.egg
Processing dependencies for gevent==1.0rc2
Searching for greenlet==0.4.0
Best match: greenlet 0.4.0
Processing greenlet-0.4.0-py2.6-linux-x86_64.egg
greenlet 0.4.0 is already the active version in easy-install.pth

Using /usr/local/lib/python2.6/dist-packages/greenlet-0.4.0-py2.6-linux-x86_64.egg
Finished processing dependencies for gevent==1.0rc2

===============================================

gevent

gevent is a coroutine-based Python networking library.

Features include:

  • Fast event loop based on libev.
  • Lightweight execution units based on greenlet.
  • Familiar API that re-uses concepts from the Python standard library.
  • Cooperative sockets with SSL support.
  • DNS queries performed through c-ares or a threadpool.
  • Ability to use standard library and 3rd party modules written for standard blocking sockets

gevent is inspired by eventlet but features more consistent API, simpler implementation and better performance. Read why othersuse gevent and check out the list of theopen source projects based on gevent.

gevent is written and maintained byDenis Bilenko and is licensed under MIT license.

get gevent

Install Python 2.5 or newer and greenlet extension.

Download the latest release from Python Package Index or clone the repository.

Read the documentation online at http://www.gevent.org

Post feedback and issues on the bug tracker, mailing list,blog andtwitter (@gevent).


===============================================

easy_install是由PEAK(Python Enterprise Application Kit)开发的setuptools包里带的一个命令,所以使用easy_install实际上是在调用setuptools来完成安装模块的工作。        Perl 用户比较熟悉 CPAN,而 Ruby 用户则比较熟悉 Gems;引导setuptools 的ez_setup工具和随之而生的扩展后的easy_install 与 “Cheeseshop”(Python Package Index,也称为 “PyPI”)一起工作来实现相同的功能。它可以很方便的让您自动下载,编译,安装和管理Python包



easy_install 安装

1、windows 下

找到一个 与你python 版本对于的setuptools 版本。比如
setuptools-0.6c9.win32-py2.5.exe  ,下载安装即可。
安装后需要配置环境变量:在系统变量path中添加F:\Python27\Scripts\,
F:\Python27是你Python的安装路径

2、linux 下

如果是ubuntu 的话,可以sudo apt-get install python-setuptools 来安装
如果是其他发行版本,可以下载后ez_setup. py,然后python ez_setup. py 安装。

===============================================


原创粉丝点击