Questions tagged [greenlets]

greenlet is a Python C-extension that adds lightweight coroutines to the language, useful for cooperative multitasking.

greenlet is a Python C-extension that adds lightweight coroutines to the language, useful for cooperative multitasking.

150 questions
0
votes
0 answers

Error using Thread.start() with Python3.9 and Gevent worker class

We have a Flask App which extensively uses threading.Thread class to spawn threads for Async API requests. Sample flask app that imitates our application is as below. from flask import Flask import threading app = Flask(__name__) @app.route('/')…
Chethu2288
  • 11
  • 4
0
votes
0 answers

Error installing flask-sqlalchemy "Could not build wheels for greenlet..."

New to flask, trying to install Flask-SQLAlchemy "pip install flask Flask-SQLAlchemy". Getting error building wheel for greenlet: error: subprocess-exited-with-error × python setup.py bdist_wheel did not run successfully. │ exit code: 1 I tried…
Kevin T
  • 45
  • 1
  • 7
0
votes
0 answers

ImportError: DLL load failed while importing _greenlet: The specified module could not be found

I tried running the command "python -m auto_py_to_exe" on Visual Studio Code/Command Prompt on a Windows 10 Virtual Machine using Python 3.9.0, Python 3.10.0/3.10.11 as well as Python 3.11. However, I always get the following: Traceback (most recent…
User2000
  • 119
  • 2
  • 8
0
votes
1 answer

missing greenlet in schema response model fastapi

My schemas: class ChannelIn(BaseModel): name: str avatar: Optional[str] description: Optional[str] class Config: arbitrary_types_allowed = True orm_mode = True class ChannelResponse(ChannelIn): id: UUID …
user21139240
0
votes
0 answers

Prefer binary package in setup.cfg

My project (https://github.com/locustio/locust) depends on greenlet, but whenever there is a new release of that, there is a brief period when no binary version is available, and many of my users have issues with installing from source. Is there a…
Cyberwiz
  • 11,027
  • 3
  • 20
  • 40
0
votes
1 answer

ModuleNotFoundError: No module named 'greenlet._greenlet'

I'm trying to use the TikTokPy but there is an error occurring in Greenlet module: $ python quickstart.py Traceback (most recent call last): File "C:\Users\mngoc\tiktokpy\quickstart.py", line 2, in from tiktokpy import TikTokPy File…
mieve
  • 1
  • 1
0
votes
0 answers

Extracting return value in gevent from a method which returns 2 values

Note: I am getting this error in unit testing. Haven't been able to deploy it to dev/prod. could it be anything to do with app context? how to create one in py.test? I recently converted a code which was doing multiple io calls to multithreaded. I…
Em Ae
  • 8,167
  • 27
  • 95
  • 162
0
votes
1 answer

Gevent infinite queue consumer?

I am trying to have a consumer on a separate thread that never dies. The consumer can get arbitrary number of tasks to execute. I have been fiddling with asyncio and gevent but haven't managed to get anything that works. Below is a very simplified…
Pithikos
  • 18,827
  • 15
  • 113
  • 136
0
votes
1 answer

Why Use gevent.joinall() Instead of pool.imap_unordered() to Run Greenlets?

The title says it all. It seems better and faster to use one of the methods belonging to gevent.Pool to run greenlets in parallel (sort-of) in a pool, as opposed to gevent.joinall(). What are the pros and cons of each approach?
Daniel
  • 2,345
  • 4
  • 19
  • 36
0
votes
0 answers

AttributeError: 'module' object has no attribute 'poll'

Trying to use gevent.select.poll for monitoring something under /sys. The below code works fine when using native Python. When i use gevent and do from gevent import monkey monkey.patch_all() from gevent import select p =…
user9763248
  • 35
  • 1
  • 5
0
votes
0 answers

gevent.hub.LoopExit: This operation would block forever

Trying to use select.select in Python to monitor something under /proc/. Initially, it threw r, w, x = select.select([],[],[fd]) AttributeError: 'function' object has no attribute 'select' Since we are using gevents, used this to get rid of…
user9763248
  • 35
  • 1
  • 5
0
votes
1 answer

TikTokApi and threading

I need to start the download process in the background and I use something like this: from threading import Thread api = TikTokApi() def foo(): url =…
0
votes
0 answers

How to gevent.sleep in current gevent.pool

Lets say I have two gevent pool groups gevent_pool_1 = Pool(2) gevent_pool_2 = Pool(2) I want to gevent.sleep(10) in gevent_pool_1 which will not block the gevent_pool_2
David Mnatsakanyan
  • 455
  • 1
  • 4
  • 15
0
votes
1 answer

How to stop a greenlet which waits for receiving from socket in a forever loop

I'm writing a simple module in my Python app to communicate with the server. I use gevent and zeromq socket. This module will run in a thread. Here is a demo import threading import gevent import zmq.green as zmq class…
shang12
  • 423
  • 5
  • 18
0
votes
1 answer

Remove stacktrace from python gevent output

I'm new to python and trying to remove/trim gevent stacktrace output when an exception is raised. I read somewhere that I can make it happen by using AsyncResult, however it seems like I can't figure out how to use this. Here is an example I started…
Roya
  • 1
  • 1