Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flask - Gevent Error

Tags:

python

gevent

I came across the following error, while trying to start a Flask-GEvent app.

My OS - W7 64 bit

C:\Users\raghul\workspace\test>python run.py
Traceback (most recent call last):
  File "run.py", line 1, in <module>
    from views import app
  File "C:\Users\raghul\workspace\test\views.py", line 4, in <module>
    from socketio import socketio_manage
  File "C:\Python27\lib\site-packages\socketio\__init__.py", line 4, in <module>

    from socketio.server import SocketIOServer
  File "C:\Python27\lib\site-packages\socketio\server.py", line 4, in <module>
    import gevent
  File "C:\Python27\lib\site-packages\gevent\__init__.py", line 40, in <module>
    from gevent import core
ImportError: DLL load failed: %1 is not a valid Win32 application.

Any Help is highly appreciated.

like image 921
user2104391 Avatar asked Mar 06 '26 18:03

user2104391


1 Answers

This is probably a 32-bit/64-bit mismatch between the Python binary and the gevent DLL.

My guess is that your Python is 64-bit and you installed the 32-bit Gevent. If this is the case, then uninstall gevent and then download the 64-bit version here. Alternatively you can install Python 32-bit and then install the official Gevent installer on it.

like image 186
Miguel Avatar answered Mar 09 '26 08:03

Miguel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!