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; a version that’s too old will produce a ValueError. 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.

  • If you see ValueError: ("Expected ',' or end-of-list in", "cffi >= 1.11.5 ; sys_platform == 'win32' and platform_python_implementation == 'CPython'", 'at', " ; sys_platform == 'win32' and platform_python_implementation == 'CPython'"), the version of setuptools is too old. Install a more recent version of setuptools.

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

Metadata

Release files for gevent 1.3.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gevent 1.3.5
File Size Uploaded
gevent-1.3.5.tar.gz 4.6 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for gevent 1.3.5
File
gevent-1.3.5-pp260-pypy_41-macosx_10_13_x86_64.whl PyPy 2.60 PyPy 4.1 macOS 10.13+ x86-64 Details
gevent-1.3.5-pp259-pypy_41-win32.whl PyPy 2.59 PyPy 4.1 Windows x86-32 Details
gevent-1.3.5-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details
gevent-1.3.5-cp36-cp36m-win_amd64.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-64 Details
gevent-1.3.5-cp36-cp36m-win32.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-32 Details
gevent-1.3.5-cp36-cp36m-manylinux1_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64 Details
gevent-1.3.5-cp36-cp36m-macosx_10_6_intel.whl CPython 3.6 CPython 3.6 pymalloc macOS 10.6+ Intel (x86-64, i386) Details
gevent-1.3.5-cp35-cp35m-win_amd64.whl CPython 3.5 CPython 3.5 pymalloc Windows x86-64 Details
gevent-1.3.5-cp35-cp35m-win32.whl CPython 3.5 CPython 3.5 pymalloc Windows x86-32 Details
gevent-1.3.5-cp35-cp35m-manylinux1_x86_64.whl CPython 3.5 CPython 3.5 pymalloc Linux glibc 2.5+ x86-64 Details
gevent-1.3.5-cp35-cp35m-macosx_10_6_intel.whl CPython 3.5 CPython 3.5 pymalloc macOS 10.6+ Intel (x86-64, i386) Details
gevent-1.3.5-cp34-cp34m-win_amd64.whl CPython 3.4 CPython 3.4 pymalloc Windows x86-64 Details
gevent-1.3.5-cp34-cp34m-win32.whl CPython 3.4 CPython 3.4 pymalloc Windows x86-32 Details
gevent-1.3.5-cp34-cp34m-manylinux1_x86_64.whl CPython 3.4 CPython 3.4 pymalloc Linux glibc 2.5+ x86-64 Details
gevent-1.3.5-cp34-cp34m-macosx_10_6_intel.whl CPython 3.4 CPython 3.4 pymalloc macOS 10.6+ Intel (x86-64, i386) Details
gevent-1.3.5-cp27-cp27mu-manylinux1_x86_64.whl CPython 2.7 CPython 2.7 pymalloc wide-unicode Linux glibc 2.5+ x86-64 Details
gevent-1.3.5-cp27-cp27m-win_amd64.whl CPython 2.7 CPython 2.7 pymalloc Windows x86-64 Details
gevent-1.3.5-cp27-cp27m-win32.whl CPython 2.7 CPython 2.7 pymalloc Windows x86-32 Details
gevent-1.3.5-cp27-cp27m-manylinux1_x86_64.whl CPython 2.7 CPython 2.7 pymalloc Linux glibc 2.5+ x86-64 Details
gevent-1.3.5-cp27-cp27m-macosx_10_9_x86_64.whl CPython 2.7 CPython 2.7 pymalloc macOS 10.9+ x86-64 Details

Total release size: 57.8 MB

Release files / gevent-1.3.5.tar.gz

Download URL gevent-1.3.5.tar.gz
Size 4.6 MB
Tags Source
SHA-256 checksum
How to use checksums
7f15861f3cc92f49663ca88c4774d26d8044783a65fbc28071a2bd1c7bf36ff0
BLAKE2b-256 checksum
How to use checksums
e60afc345c6e6161f84484870dbcaa58e427c10bd9bdcd08a69bed3d6b398bf1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / gevent-1.3.5-pp260-pypy_41-macosx_10_13_x86_64.whl

Download URL gevent-1.3.5-pp260-pypy_41-macosx_10_13_x86_64.whl
Size 696.1 kB
Tags PyPy 2.60 PyPy 4.1 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
425edae7557599f16bf428b84d58f5aa5623c7ed9c2c2ef4a915046799992069
BLAKE2b-256 checksum
How to use checksums
522d90f5745d4a8ddf18f5dd28dd33764b863588ebee135fe9331c4c93ff2b95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / gevent-1.3.5-pp259-pypy_41-win32.whl

Download URL gevent-1.3.5-pp259-pypy_41-win32.whl
Size 671.4 kB
Tags PyPy 2.59 PyPy 4.1 Windows x86-32
SHA-256 checksum
How to use checksums
298fff6b452e879ffd8de2cf17b453469bef4f34fecc1c3d2252358d01000d42
BLAKE2b-256 checksum
How to use checksums
2462ac1bf8394b4df377c61cbc21695eb867e609c110fdc1229e4cfe2ecd2fa5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / gevent-1.3.5-cp37-cp37m-win_amd64.whl

Download URL gevent-1.3.5-cp37-cp37m-win_amd64.whl
Size 2.1 MB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
5fcf30b6172c6ae4f89dbe6051971a71bb04080d0eda9a0c31862054346d1ddd
BLAKE2b-256 checksum
How to use checksums
1cf64e586d562ec1aa5ed8412c8254a8d25301180e0a970947d806329e6345c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / gevent-1.3.5-cp36-cp36m-win_amd64.whl

Download URL gevent-1.3.5-cp36-cp36m-win_amd64.whl
Size 2.1 MB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
916457841e4f335ccd228ac274801f1773973d27be3c53ed3ee1209f7629950e
BLAKE2b-256 checksum
How to use checksums
31513ac1065fdd957c77fa488d1e97848f5d37b9b2fc8f0ed22b304801163eea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / gevent-1.3.5-cp36-cp36m-win32.whl

Download URL gevent-1.3.5-cp36-cp36m-win32.whl
Size 1.9 MB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
201b14bb62f72073369f86f21f824bfc079477b864590d43574d625266d358ec
BLAKE2b-256 checksum
How to use checksums
337316b9b2d2f8d51c65ae5b61378b764755086395f290d5de574d2ace773055
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / gevent-1.3.5-cp36-cp36m-manylinux1_x86_64.whl

Download URL gevent-1.3.5-cp36-cp36m-manylinux1_x86_64.whl
Size 4.6 MB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
e2e3a6a2a147330d24e6e2b2f144c196841a707a41ee61253565d400ed7df62f
BLAKE2b-256 checksum
How to use checksums
b62b6be042be1023df54889d9e2a90b167f6fea65445384fccfdfd988cc16239
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / gevent-1.3.5-cp36-cp36m-macosx_10_6_intel.whl

Download URL gevent-1.3.5-cp36-cp36m-macosx_10_6_intel.whl
Size 3.1 MB
Tags CPython 3.6 CPython 3.6 pymalloc macOS 10.6+ Intel (x86-64, i386)
SHA-256 checksum
How to use checksums
bd34e943810df73d7bf346262dae09281d045edebd086205e9ff2db377bae060
BLAKE2b-256 checksum
How to use checksums
241e970a7c4690f86b120df25985ba2e99cd50c136f8e54204706acb75c717c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / gevent-1.3.5-cp35-cp35m-win_amd64.whl

Download URL gevent-1.3.5-cp35-cp35m-win_amd64.whl
Size 2.1 MB
Tags CPython 3.5 CPython 3.5 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
a52f5cef4073d9e8d58c8c44d4795cbc2e298d374125745637d8f078f8970b6b
BLAKE2b-256 checksum
How to use checksums
a4f3fd016dc08e43395553e3741efcc2aba4798b44fe385691fde51b8e08a050
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / gevent-1.3.5-cp35-cp35m-win32.whl

Download URL gevent-1.3.5-cp35-cp35m-win32.whl
Size 1.9 MB
Tags CPython 3.5 CPython 3.5 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
8bbf3f2ab60e39be4363923d2b5996bff65d4163fe560280b71bb8ca18df2055
BLAKE2b-256 checksum
How to use checksums
5424d9666f5ac5214c29abf545ac991b765b94439a5df5e077f5e3d3a1a5d9d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / gevent-1.3.5-cp35-cp35m-manylinux1_x86_64.whl

Download URL gevent-1.3.5-cp35-cp35m-manylinux1_x86_64.whl
Size 4.5 MB
Tags CPython 3.5 CPython 3.5 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
55fa0607b72710372d37b35e9af85755a0c8bd0e3e82d70970a349feb2b426f6
BLAKE2b-256 checksum
How to use checksums
6cc355290480d3c992fbe563478e302fb0bf228ccca398174de6cca3dff9d11c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / gevent-1.3.5-cp35-cp35m-macosx_10_6_intel.whl

Download URL gevent-1.3.5-cp35-cp35m-macosx_10_6_intel.whl
Size 3.1 MB
Tags CPython 3.5 CPython 3.5 pymalloc macOS 10.6+ Intel (x86-64, i386)
SHA-256 checksum
How to use checksums
d0a4d114890b6d619e81140550c45d3611588c00f2baa1d6af9362907687ca1d
BLAKE2b-256 checksum
How to use checksums
ba4a68cc27925a231aeb68eac95b8cd7a18e0f6a997b51ecdabd5f42c5b1b78b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / gevent-1.3.5-cp34-cp34m-win_amd64.whl

Download URL gevent-1.3.5-cp34-cp34m-win_amd64.whl
Size 2.1 MB
Tags CPython 3.4 CPython 3.4 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
77abcc8a9e04d33325b79d2130e1faf32a02069e63131c184802bb79fb5711d1
BLAKE2b-256 checksum
How to use checksums
0127844a8606bb9fa121b7392300bac9ca6e3623219b1dd1aff1805a107708b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / gevent-1.3.5-cp34-cp34m-win32.whl

Download URL gevent-1.3.5-cp34-cp34m-win32.whl
Size 2.0 MB
Tags CPython 3.4 CPython 3.4 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
82e0eb07ab596908295d49f27e84799bff73638e13699496048d13051c8421a1
BLAKE2b-256 checksum
How to use checksums
1c5521ea153f3eb7c23e12cf13cb6d9af9120ada96fa236cb5191eeeb3ed5af6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / gevent-1.3.5-cp34-cp34m-manylinux1_x86_64.whl

Download URL gevent-1.3.5-cp34-cp34m-manylinux1_x86_64.whl
Size 4.5 MB
Tags CPython 3.4 CPython 3.4 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
2e9c15461ead5714fa70fb0179927410fcaeb39125ead575472a45d13973de32
BLAKE2b-256 checksum
How to use checksums
4d73eea9e518f95e9ed23d6edacaa54e4c0fc595c43c98181cb0f2d5594c38b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / gevent-1.3.5-cp34-cp34m-macosx_10_6_intel.whl

Download URL gevent-1.3.5-cp34-cp34m-macosx_10_6_intel.whl
Size 3.1 MB
Tags CPython 3.4 CPython 3.4 pymalloc macOS 10.6+ Intel (x86-64, i386)
SHA-256 checksum
How to use checksums
32a231c52a5e8c0a5e62ffa2d25f14cfa5fe6bc8856093f5babe3f1e32d471d3
BLAKE2b-256 checksum
How to use checksums
8f543cdfee4fce9237aa20d3886ed98b2e8c758d73826625ab56003fb92e1e22
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / gevent-1.3.5-cp27-cp27mu-manylinux1_x86_64.whl

Download URL gevent-1.3.5-cp27-cp27mu-manylinux1_x86_64.whl
Size 4.2 MB
Tags CPython 2.7 CPython 2.7 pymalloc wide-unicode Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
8a8bcb9bbf7af0527ef77d86fa094b647d0e8cd377c5e31c1ad1a3d456b4a10b
BLAKE2b-256 checksum
How to use checksums
34f70bdf6205d8ecbbfc1d2a4611a0b19e75ce00f622d0cb23852c4c15fb8ce5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / gevent-1.3.5-cp27-cp27m-win_amd64.whl

Download URL gevent-1.3.5-cp27-cp27m-win_amd64.whl
Size 2.1 MB
Tags CPython 2.7 CPython 2.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
6eb85cce56bf530664f7661c4bf2fe5d9d4de231c1cd2860c7563c517a6f56dc
BLAKE2b-256 checksum
How to use checksums
f15461ae4d9e1078c52047fa625cf39c8197517baa45599174e5d3ed91105b8a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / gevent-1.3.5-cp27-cp27m-win32.whl

Download URL gevent-1.3.5-cp27-cp27m-win32.whl
Size 2.0 MB
Tags CPython 2.7 CPython 2.7 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
aa04c207f6abb5d34de148e08b4d461544e808534000c4e5429eda08aa1204d6
BLAKE2b-256 checksum
How to use checksums
dc36746daf471141227d9ffe9f31d198a5d8456e2d3c25e8c83de9395e6f2e41
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / gevent-1.3.5-cp27-cp27m-manylinux1_x86_64.whl

Download URL gevent-1.3.5-cp27-cp27m-manylinux1_x86_64.whl
Size 4.2 MB
Tags CPython 2.7 CPython 2.7 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
856ed81267a802eeaf925d7bf1a676c721f90c162c05ae906ab9c4646086c1a3
BLAKE2b-256 checksum
How to use checksums
be96a72d0e8fe2379ac7a9ccf8b956a9b883f3ca1e38f731cf2682d862f00a66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / gevent-1.3.5-cp27-cp27m-macosx_10_9_x86_64.whl

Download URL gevent-1.3.5-cp27-cp27m-macosx_10_9_x86_64.whl
Size 2.2 MB
Tags CPython 2.7 CPython 2.7 pymalloc macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
a46b85bb42aeeab11f140587b8482d0f04d4b3db6f20f6668624bb0a822a28b0
BLAKE2b-256 checksum
How to use checksums
9279a2eae0ab0c715b73584d10d32918afd3edd5f4f4be16c53ec9c8e974bb8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

1.5.0

23 release files

1.3.7

23 release files

1.3.6

23 release files

This release

1.3.5 This release

21 release files

1.3.4

22 release files

1.3.2

16 release files

1.3.1

21 release files

1.3.0

21 release files

1.2.1

28 release files

1.2.0

21 release files

1.1.2

26 release files

1.0.2

7 release files

1.0.1

1 release file

1.0

1 release file

0.13.7

7 release files

0.13.6

1 release file

0.13.5

1 release file

0.13.4

1 release file

0.13.3

1 release file

0.13.2

7 release files

0.13.1

7 release files

0.13.0

7 release files

0.12.2

1 release file

0.12.1

1 release file

0.12.0

1 release file

0.11.2

1 release file

0.11.1

1 release file

0.11.0

1 release file

0.10.0

1 release file

0.9.3

1 release file

0.9.2

1 release 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