Can't Run Gevent on Python3.7

1,722 views
Skip to first unread message

sompa...@gmail.com

unread,
Aug 30, 2020, 10:18:58 AM8/30/20
to gevent: coroutine-based Python network library
I am trying to run gevent for my Python 3.7.0b3 virtual env (ubuntu-1804)

I am getting the following error
Error: class uri 'gevent' invalid or not found:






[Traceback (most recent call last):

 
File "/opt/superset-prod/prodsuperset/lib/python3.7/site-packages/gunicorn/util.py", line 99, in load_class

    mod
= importlib.import_module('.'.join(components))

 
File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module

   
return _bootstrap._gcd_import(name[level:], package, level)

 
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import

 
File "<frozen importlib._bootstrap>", line 983, in _find_and_load

 
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked

 
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked

 
File "<frozen importlib._bootstrap_external>", line 726, in exec_module

 
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed

 
File "/opt/superset-prod/prodsuperset/lib/python3.7/site-packages/gunicorn/workers/ggevent.py", line 14, in <module>

   
import gevent

 
File "/opt/superset-prod/prodsuperset/lib/python3.7/site-packages/gevent/__init__.py", line 98, in <module>

   
from gevent.os import fork

 
File "/opt/superset-prod/prodsuperset/lib/python3.7/site-packages/gevent/os.py", line 495, in <module>

    _raw_posix_spawnp
= os.posix_spawnp

AttributeError: module 'os' has no attribute 'posix_spawnp'


Any Help regarding this ?

Jason Madden

unread,
Aug 30, 2020, 10:32:28 AM8/30/20
to gev...@googlegroups.com, sompa...@gmail.com
In short, please upgrade your Python to a released version. gevent does not support Python 3.7 beta 3, but does support released versions; gevent is currently tested against 3.7.5 and 3.7.7.

`posix_spawn` and `posix_spawnp` are APIs that were added to Python 3.8. Unfortunately, in Python 3.7.0b1, a preliminary version of `posix_spawn` was added, *without* adding `posix_spawnp`. This was later removed in 3.7.0b5 because the API was considered too unfinished; gevent relies on both APIs being available if one is. Consequently, it won't run on 3.7b1 through 3.7b4 at least.

~Jason

Grady Player

unread,
Aug 31, 2020, 7:42:27 AM8/31/20
to gev...@googlegroups.com
It sounds like you haven’t installed gevent in your virtual env...

With that venv active run
pip install gevent

Grady


Sent from my iPhone

On Aug 30, 2020, at 8:19 AM, sompa...@gmail.com wrote:


--
You received this message because you are subscribed to the Google Groups "gevent: coroutine-based Python network library" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gevent+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gevent/c8962181-571f-4c57-b083-ed7f749e028ao%40googlegroups.com.

Akash Agrawal

unread,
Nov 22, 2022, 5:42:47 AM11/22/22
to gevent: coroutine-based Python network library
If you're getting this in late 2022 or later, this might be of interest: https://github.com/python-greenlet/greenlet/issues/178
gevent 20.9.0 had an unbounded dependency on greenlet, and they just released a breaking change. Pinning the greenlet version seems to help here.
Reply all
Reply to author
Forward
0 new messages