Using gevent.evnet with celery.task

I've been working on a long-polling system. I use flask + mongokit + celery + gevent. When the process in celery task is done, gevent.event.set() doesn't work. I want help to figure it out. (The...

Gunicorn 'ImportError: No module named app.wsgiapp' on heroku

I cannot run gunicorn on heroku with simple flask app. The application is really simple. This is app.py: app = Flask(__name__) @app.route("/") def say_hello(url): return "Hello" if __name__...

Fire off function without waiting for answer (Python)

I have a stream of links coming in, and I want to check them for rss every now and then. But when I fire off my get_rss() function, it blocks and the stream halts. This is unnecessary, and I'd...

Flask Hangs on request

Recently I'm developing a Flask website/api app to Windows Server and saw some weird issue going on. When someone make a request to a url, occasionally(like 3-4 out of 10 times) it will hang. All...

Python - Flask-SocketIO send message from thread: not always working

I am in the situation where I receive a message from the client. Within the function that handles that request (@socketio.on) I want to call a function where some heavy work is done. This should...

H14 error in heroku - "no web processes running"

error H14 happen while deploying to heroku this is my procfile: web: gunicorn -w 4 -b 0.0.0.0:$PORT -k gevent main:app log on heroku: 2017-01-23T10:42:58.904480+00:00 heroku[router]: at=error...

How to poll python asyncio task status

With gevent, I can monitor a long running function like so: greenlet = gevent.Greenlet(long_running_task, *args, **kwargs) greenlet.start() while not greenlet.ready(): ...

Python connexion not displaying Swagger UI

I've built a Python/Flask based REST API using the connexion module. This working well as defining the REST API with with swagger.yml file works very well. The application is running, but when I...

Connexion Python framework set multiprocesses

I try to configure Connexion to set the number of processes or threads as is possible in Flask framework. This is possible in Flask but it seems that Connexion is not sending this configuration to...

Python: why do I get an error when I import geopandas?

I try to import geopandas in my jupyter notebook. import geopandas as gp and I get the following error: ImportError:...

WEBP support not installed error with Pillow included in Anaconda

I have written a small code to open webp image in the Anaconda prompt. from PIL import Image im = Image.open('test.webp') It causes the following...

How to communicate between traditional thread and asyncio thread in Python?

In python, what's the idiomatic way to establish a one-way communication between two threading.Threads, call them thread a and thread b. a is the producer, it continuously generates values for b...

Error installing gevent in Docker Alpine Python

I'm trying to install gevent on docker image python:3.8.0a4-alpine3.9 which is running gunicorn. When building the docker, I always get an error "gcc failed with exit status 1". I've tried...

How to check uwsgi with gevent at socket file in k8s readinessProbe and livenessProbe

I have a flask app with uwsgi and gevent. Here is my app.ini How could I write readinessProbe and livenessProbe on kubernetes to check to flask app? [uwsgi] socket = /tmp/uwsgi.sock chdir =...

"AssertionError: Torch not compiled with CUDA enabled" in spite upgrading to CUDA version

I figured out this is a popular question, but still I couldn't find a solution for that. I'm trying to run a simple repo Here which uses PyTorch. Although I just upgraded my Pytorch to the latest...

Flask gevent threads are stuck on kafka consumer

We have a flask app, deploying using gunicorn in gevent worker mode. The app itself listen to few REST apis but also have a kafka consumer (using confluent client) it listen to. When we deploy the...

Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output - while installing auto-py-to-exe through pip

I am trying to download auto-py-to-exe on a different (windows) device than I usually use through pip. However when run I get the error (sorry it is so very very long): ERROR: Command errored out...

RuntimeError when running 3D Ken Burns Effect

I'm trying to run a Google Colab of the 3d Ken Burns effect that can be found here https://colab.research.google.com/github/agmm/colab-3d-ken-burns/blob/master/automatic-3d-ken-burns.ipynb I've...

System open file limit causing Locust error

I have a question about Locust. I wrote simple script just to check if Locust work. It should check if I can login to app which I'm testing with phone number and password. I start it with...

What is the best way for a Python script to communicate with a Python Flask server that transports content to the client?

The following scenario: I have a Raspberry Pi running as a server. Currently I am using a Python script with Flask and I can also access the Raspberry Pi from my PC. (The flask server runs an...

Python Websceraping: grequests vs. mult-threaded requests?

I'm trying to make web-scraper I'm writing in Python faster. Currently I fire up a set amount of scarper threads, create a queue with a list of URLs I want to scrape and let them dequeue entries...

How to solve libpq.so.5 Import error when running postgresql on alpine in docker

Hi I am trying to run postgresql in alpine in docker with SQLAlchemy and flask but anytime I run my app I get this error ImportError: Error loading shared library libpq.so.5: No such file or...

PyCharm Plotting Issue "Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)"

Within PyCharm (Versions 2020.3) I'm unable to show any plots and I get an error. I've tried following other recommendations of going into PyCharm settings and unselecting "PyQt" as well as...

Eventlet heroku flasksocketio app not working

I'm Having lots of trouble deploying my Flask app that uses websockets to heroku. It works fine with heroku local and even works fine when the same command in run locally. web: gunicorn...

Using apache-airflow-providers-snowflake on airflow (no module named Snowflake)

I have installed package apache-airflow-providers-snowflake on airflow on docker and i am getting error No module named Snowflake Please refer attachment (check the error mentioned for the...

Android Studio Socket.io disconnecting and reconnecting every few seconds

I have a setup right now where I am running a flask server that handles websocket communication between and android phone and a raspberry pi node.js socket.io client. The android socket.io can...

Sagemaker deploy model with inference code and requirements

I trained a TensorFlow model and now I would like to deploy it. The data needs to be processed thus I have to specify one inference.py script and one requirements.txt file. When I deploy the...

Locust-plugins Unhandled exception in greenlet: <Greenlet at 0x7fde698e57b0: <lambda>>

I've switched to Ubuntu to get a Locust/Selenium solution going. I'm running a very simple script but when running the script through the WebUI I'm receiving an exception error: Unhandled...

An error occurred while packaging. Using pyinstaller

I'm trying to build a python file into a exe file. I don't get it since it builds on some days and gives errors on others. The python script works normally when I run it in CMD or Visual Code. I...

Why can't Python 3 virtualenv find some installed packages?

I am working with a Python virtualenv named env to execute Odoo. In the virtualenv bin directory, I got this: pip pip3 pip3.8 python -> /usr/bin/python3 python3 -> python python3.8 ->...