Skip to main content

gevent

https://travis-ci.org/gevent/gevent.svg?branch=master https://ci.appveyor.com/api/projects/status/q4kl21ng2yo2ixur?svg=true https://coveralls.io/repos/gevent/gevent/badge.svg?branch=master&service=github

gevent is a coroutine -based Python networking library that uses greenlet to provide a high-level synchronous API on top of the libev or libuv event loop.

Features include:

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

gevent was written by Denis Bilenko.

Since version 1.1, gevent is maintained by Jason Madden for NextThought with help from the contributors and is licensed under the MIT license.

See what’s new in the latest major release.

Check out the detailed changelog for this version.

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

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

Installation and Requirements

Supported Platforms

gevent 1.3 runs on Python 2.7 and Python 3. Releases 3.4, 3.5 and 3.6 of Python 3 are supported. (Users of older versions of Python 2 need to install gevent 1.0.x (2.5), 1.1.x (2.6) or 1.2.x (<=2.7.8); gevent 1.2 can be installed on Python 3.3.) gevent requires the greenlet library and will install the cffi library by default on Windows.

gevent 1.3 also runs on PyPy 5.5 and above, although 5.9 or above is strongly recommended. On PyPy, there are no external dependencies.

gevent is tested on Windows, OS X, and Linux, and should run on most other Unix-like operating systems (e.g., FreeBSD, Solaris, etc.)

Installation

gevent and greenlet can both be installed with pip, e.g., pip install gevent. Installation using buildout is also supported.

On Windows, OS X, and Linux, both gevent and greenlet are distributed as binary wheels.

Installing From Source

If you are unable to use the binary wheels (for platforms where no pre-built wheels are available or if wheel installation is disabled, e.g., for libuv support on Linux), here are some things you need to know.

  • You can install gevent from source with pip install --no-binary gevent gevent.

  • You’ll need a working C compiler that can build Python extensions. On some platforms, you may need to install Python development packages.

  • Installing from source requires setuptools. This is installed automatically in virtual environments and by buildout. However, gevent uses PEP 496 environment markers in setup.py. Consequently, you’ll need a version of setuptools newer than 25 (mid 2016) to install gevent from source. Older versions of pipenv may also have issues installing gevent for this reason.

  • To build the libuv backend (which is required on Windows and optional elsewhere), or the CFFI-based libev backend, you must install cffi before attempting to install gevent on CPython (on PyPy this step is not necessary).

Common Installation Issues

The following are some common installation problems and solutions for those compiling gevent from source.

  • Some Linux distributions are now mounting their temporary directories with the noexec option. This can cause a standard pip install gevent to fail with an error like cannot run C compiled programs. One fix is to mount the temporary directory without that option. Another may be to use the --build option to pip install to specify another directory. See issue #570 and issue #612 for examples.

  • Also check for conflicts with environment variables like CFLAGS. For example, see Library Updates.

  • Users of a recent SmartOS release may need to customize the CPPFLAGS (the environment variable containing the default options for the C preprocessor) if they are using the libev shipped with gevent. See Operating Systems for more information.

Extra Dependencies

gevent has no runtime dependencies outside the standard library, greenlet and (on some platforms) cffi. However, there are a number of additional libraries that extend gevent’s functionality and will be used if they are available.

The psutil library is needed to monitor memory usage.

zope.event is highly recommended for configurable event support; it can be installed with the events extra, e.g., pip install gevent[events].

dnspython is required for the new pure-Python resolver, and on Python 2, so is idna. They can be installed with the dnspython extra.

Development

To install the latest development version:

pip install setuptools cffi 'cython>=0.28' git+git://github.com/gevent/gevent.git#egg=gevent

To hack on gevent (using a virtualenv):

$ git clone https://github.com/gevent/gevent.git
$ cd gevent
$ virtualenv env
$ source env/bin/activate
(env) $ pip install -r dev-requirements.txt

Running Tests

There are a few different ways to run the tests. To simply run the tests on one version of Python during development, begin with the above instructions to install gevent in a virtual environment and then run:

(env) $ cd src/greentest
(env) $ python ./testrunner.py

Before submitting a pull request, it’s a good idea to run the tests across all supported versions of Python, and to check the code quality using prospector. This is what is done on Travis CI. Locally it can be done using tox:

pip install tox
tox

The testrunner accepts a --coverage argument to enable code coverage metrics through the coverage.py package. That would go something like this:

cd src/greentest
python testrunner.py --coverage
coverage combine
coverage html -i
<open htmlcov/index.html>

Continuous integration

A test suite is run for every push and pull request submitted. Travis CI is used to test on Linux, and AppVeyor runs the builds on Windows.

https://travis-ci.org/gevent/gevent.svg?branch=master https://ci.appveyor.com/api/projects/status/q4kl21ng2yo2ixur?svg=true

Builds on Travis CI automatically submit updates to coveralls.io to monitor test coverage.

https://coveralls.io/repos/gevent/gevent/badge.svg?branch=master&service=github

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gevent-1.3.2.tar.gz (4.6 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

gevent-1.3.2-pp260-pypy_41-macosx_10_13_x86_64.whl (691.0 kB view details)

Uploaded PyPymacOS 10.13+ x86-64

gevent-1.3.2-pp259-pypy_41-win32.whl (666.0 kB view details)

Uploaded PyPyWindows x86

gevent-1.3.2-cp37-cp37m-macosx_10_9_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

gevent-1.3.2-cp36-cp36m-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.6mWindows x86-64

gevent-1.3.2-cp36-cp36m-win32.whl (1.9 MB view details)

Uploaded CPython 3.6mWindows x86

gevent-1.3.2-cp36-cp36m-macosx_10_6_intel.whl (3.1 MB view details)

Uploaded CPython 3.6mmacOS 10.6+ Intel (x86-64, i386)

gevent-1.3.2-cp35-cp35m-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.5mWindows x86-64

gevent-1.3.2-cp35-cp35m-win32.whl (1.9 MB view details)

Uploaded CPython 3.5mWindows x86

gevent-1.3.2-cp35-cp35m-macosx_10_6_intel.whl (3.1 MB view details)

Uploaded CPython 3.5mmacOS 10.6+ Intel (x86-64, i386)

gevent-1.3.2-cp34-cp34m-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.4mWindows x86-64

gevent-1.3.2-cp34-cp34m-win32.whl (2.0 MB view details)

Uploaded CPython 3.4mWindows x86

gevent-1.3.2-cp34-cp34m-macosx_10_6_intel.whl (3.1 MB view details)

Uploaded CPython 3.4mmacOS 10.6+ Intel (x86-64, i386)

gevent-1.3.2-cp27-cp27m-win_amd64.whl (2.1 MB view details)

Uploaded CPython 2.7mWindows x86-64

gevent-1.3.2-cp27-cp27m-win32.whl (2.0 MB view details)

Uploaded CPython 2.7mWindows x86

gevent-1.3.2-cp27-cp27m-macosx_10_9_x86_64.whl (2.2 MB view details)

Uploaded CPython 2.7mmacOS 10.9+ x86-64

File details

Details for the file gevent-1.3.2.tar.gz.

File metadata

  • Download URL: gevent-1.3.2.tar.gz
  • Upload date:
  • Size: 4.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for gevent-1.3.2.tar.gz
Algorithm Hash digest
SHA256 390d820f375626cd0406fdf9b2657f796818fa53c7cff34a9af0e34a4d6bc4ea
MD5 0f9384d7dde4e2c100ee41c63c3728ef
BLAKE2b-256 62853a75fa15a5375506a6617c1ce706ea800f016ca2be1a87165f1ab5aff3a2

See more details on using hashes here.

File details

Details for the file gevent-1.3.2-pp260-pypy_41-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for gevent-1.3.2-pp260-pypy_41-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 6d7273ac33059b9fff3a538e0662c7a500b3e15d3656276e723cd84556760fd3
MD5 27b495cf24ae834ac035b41edbec19d9
BLAKE2b-256 06c3ceca34a567d3e9d4e08a72275a9133a26701fc9c2dac3a4c3f032e821a25

See more details on using hashes here.

File details

Details for the file gevent-1.3.2-pp259-pypy_41-win32.whl.

File metadata

File hashes

Hashes for gevent-1.3.2-pp259-pypy_41-win32.whl
Algorithm Hash digest
SHA256 2d2f4e89aa67272ab05cb847b1096c0b2c5d91a9f34bc0cd030725037631cb49
MD5 6d94f5d9ea85ab7ad404949e988d83ce
BLAKE2b-256 c33869963ed9254e2c1b99ea580fa1d81d553b14cbca0748f5f1610ee2b6915e

See more details on using hashes here.

File details

Details for the file gevent-1.3.2-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for gevent-1.3.2-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 9bca91e7baf4e54609f302689f55591e579d1cfba91bba422c2a4ba0d30fe5be
MD5 a0b6a0b239badae069feaaa79c049ac0
BLAKE2b-256 1626523e78ba481f7b0eda521db60475fc72b7a952cb7d9258e1c0265d5c7fab

See more details on using hashes here.

File details

Details for the file gevent-1.3.2-cp36-cp36m-win_amd64.whl.

File metadata

File hashes

Hashes for gevent-1.3.2-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 9a1a624d4b2b672c4a33d1d7af7e3a78b0714cc22dccdd837310f22a67f60a2c
MD5 2874e429a8b462bf46d43c28110fa571
BLAKE2b-256 81a4385631a1b25366dff2380815f8205ff8c5e339d81248a017881197271656

See more details on using hashes here.

File details

Details for the file gevent-1.3.2-cp36-cp36m-win32.whl.

File metadata

File hashes

Hashes for gevent-1.3.2-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 f039362312b64499984839a1db13196dc066fc1421aa82f9b0590b3b1e62a4f9
MD5 ce463aff05ed9ede37d5058a1df912a0
BLAKE2b-256 f0a9592a9a67056a7102b6dcf7c4b213c26ff44a69df930a3dc88e1d86a11e5e

See more details on using hashes here.

File details

Details for the file gevent-1.3.2-cp36-cp36m-macosx_10_6_intel.whl.

File metadata

File hashes

Hashes for gevent-1.3.2-cp36-cp36m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 bdb14421d3b0a0f16ad1b2824c15f772f8e63a89d848ac75b98d43f2e0cf7c4c
MD5 dd197cd4ec92f3ddc9dd28a07c4c655f
BLAKE2b-256 b5ecb1532e19af2f84e08ff268f24c36e5554cc0a52e32542f40f8aeab066021

See more details on using hashes here.

File details

Details for the file gevent-1.3.2-cp35-cp35m-win_amd64.whl.

File metadata

File hashes

Hashes for gevent-1.3.2-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 fc59dbcdb335813eef2e2ac9c39bdc94381b8236dcf3aad3fc58cdf8c8c1dc9d
MD5 fd806003e279a593fb6e771c7f1350d4
BLAKE2b-256 f4c4347f89601bc9b6547692acaaad0c6a65962db6a64a9c01fb7c6e49b2cf86

See more details on using hashes here.

File details

Details for the file gevent-1.3.2-cp35-cp35m-win32.whl.

File metadata

File hashes

Hashes for gevent-1.3.2-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 f31da5d30697e483b457e28a0457f31a7c3d50883f9521318922b34a9b5604f9
MD5 ebde8fa8dd28198360d753412da5d9ad
BLAKE2b-256 d66d8faefc3ed3ff0006ff0a2b54ebd009cfbca84fca5ea1ef8dc8d3c893528f

See more details on using hashes here.

File details

Details for the file gevent-1.3.2-cp35-cp35m-macosx_10_6_intel.whl.

File metadata

File hashes

Hashes for gevent-1.3.2-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 f8fad34b24c9797ef8d2cbf280e363f46706899e748bcc9cd422807e020d12c6
MD5 7f9d33b0e9ff9b74f6c4fd28b6404357
BLAKE2b-256 4e78797d5aa39c2aabf26c1a6fc40946e141de792be9c1ab70040fb93ec57e27

See more details on using hashes here.

File details

Details for the file gevent-1.3.2-cp34-cp34m-win_amd64.whl.

File metadata

File hashes

Hashes for gevent-1.3.2-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 352bc1f057ddb660b71ed60b407c9c7f3e1c896df624108f5df6c2eda6dbcd6e
MD5 48dd95e9ffc5fd192113f74fbcbc52c7
BLAKE2b-256 35be3c9330dd19ab183b7c5d835601c8b2e83c80a064208022bae114e2364a64

See more details on using hashes here.

File details

Details for the file gevent-1.3.2-cp34-cp34m-win32.whl.

File metadata

File hashes

Hashes for gevent-1.3.2-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 9fc9cc12628c01b4fd32720bf3dd7935960536fdd1a19c86ca45c8e9dd576114
MD5 ed7237c6ed2eb82586dda9e747818f14
BLAKE2b-256 4daa2621e3b5ee35bf3ac2feda7120ee881804504884948d70978d0e48aa4138

See more details on using hashes here.

File details

Details for the file gevent-1.3.2-cp34-cp34m-macosx_10_6_intel.whl.

File metadata

File hashes

Hashes for gevent-1.3.2-cp34-cp34m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 411afec853ceb5e73a63f4be04393404c395801db1dd6e9149e2f9a3ebb78e2c
MD5 60d2be4862697e55f4445ed7726ce5d7
BLAKE2b-256 351b823cc95f6339d7d51c072a63370cc8d9946b58c95ebff537f9aed6c23d8a

See more details on using hashes here.

File details

Details for the file gevent-1.3.2-cp27-cp27m-win_amd64.whl.

File metadata

File hashes

Hashes for gevent-1.3.2-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 9c78dda7b015ae9eb46469a00b1105f43a8a7c60f2e5599d32d4120ca407b70b
MD5 6b872ac899b042c140c73c2e9215f965
BLAKE2b-256 cd7ed311c30aa5ce0fcb72f6112dc4b9adbc26c339719e2dbd0d2806a3e62d66

See more details on using hashes here.

File details

Details for the file gevent-1.3.2-cp27-cp27m-win32.whl.

File metadata

File hashes

Hashes for gevent-1.3.2-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 3af2b117ac8067fc01579148d2002a58f9537f7063eb4d184307075e0d0b11b7
MD5 934b7068e1b00172fbea7bb8ed579624
BLAKE2b-256 bcdf28317929cba40d047b759f2d23641ef17542649147865384d3cb679efd29

See more details on using hashes here.

File details

Details for the file gevent-1.3.2-cp27-cp27m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for gevent-1.3.2-cp27-cp27m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 28c8406c6d0788a786f243d7be979a2279fb00c4938b9c61f45fadb3acf0efdf
MD5 451ab723a86a6ea2dde68ec8476dbe1e
BLAKE2b-256 52ec88efddd6448dbfd84701282aa327f8d503d18c698565f08792beeb669a60

See more details on using hashes here.

Release history Release notifications | RSS feed

26.8.0

48 files

26.7.0

46 files

26.5.0

47 files

26.4.0

35 files

25.9.1

43 files

25.8.2

44 files

25.8.1

44 files

25.5.1

39 files

25.4.2

39 files

25.4.1

39 files

24.11.1

38 files

24.10.3

38 files

24.10.2

38 files

24.10.1

38 files

24.2.1

41 files

23.9.1

40 files

23.9.0.post1

35 files

23.9.0

29 files

23.7.0

31 files

22.10.2

52 files

22.10.1

38 files

22.8.0

35 files

21.12.0

33 files

21.8.0

26 files

21.1.2

28 files

21.1.1

23 files

21.1.0

24 files

20.12.1

24 files

20.12.0

26 files

20.9.0

24 files

20.6.2

28 files

20.6.1

23 files

20.6.0

22 files

20.5.2

22 files

20.5.1

22 files

20.5.0

22 files

20.4.0

24 files

1.5.0

23 files

1.4.0

23 files

1.3.7

23 files

1.3.6

23 files

1.3.5

21 files

1.3.4

22 files

1.3.3

21 files

1.3.2.post0

21 files

This release

1.3.2 This release

16 files

1.3.1

21 files

1.3.0

21 files

1.2.2

29 files

1.2.1

28 files

1.2.0

21 files

1.1.2

26 files

1.1.1

25 files

1.1.0

28 files

1.0.2

7 files

1.0.1

1 file

1.0

1 file

0.13.8

5 files

0.13.7

7 files

0.13.6

1 file

0.13.5

1 file

0.13.4

1 file

0.13.3

1 file

0.13.2

7 files

0.13.1

7 files

0.13.0

7 files

0.12.2

1 file

0.12.1

1 file

0.12.0

1 file

0.11.2

1 file

0.11.1

1 file

0.11.0

1 file

0.10.0

1 file

0.9.3

1 file

0.9.2

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page