The dependencies for python-socketio seem to be broken as I am still able to reproduce bugs reported in https://github.com/miguelgrinberg/python-socketio/issues/218#issuecomment-444505384 and https://github.com/miguelgrinberg/Flask-SocketIO/issues/848.
Run the following commands from a shell on Linux:
python -m venv virtualenv
. virtualenv/bin/activate
pip install python-engineio==2.3.2
pip install python-socketio
python -c "import socketio"
The last command (import socketio from Python) succeeds.
The last command (import socketio from Python) fails with the following exception:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/virtualenv/lib/python3.7/site-packages/socketio/__init__.py", line 10, in <module>
from .middleware import WSGIApp, Middleware
File "/virtualenv/lib/python3.7/site-packages/socketio/middleware.py", line 4, in <module>
class WSGIApp(engineio.WSGIApp):
AttributeError: module 'engineio' has no attribute 'WSGIApp'
python-engineio==3.0.0 fixes the issue. However, setup.py for python-socketio contains python-engineio>=2.2.0, so I would expect the import to work also with 2.3.2. Also, the import fails with 2.2.0.pip freeze:
python-engineio==2.3.2
python-socketio==2.1.1
six==1.12.0
Fixed in version 2.1.2.
I am still getting the error AttributeError: module 'engineio' has no attribute 'WSGIApp'.
Here is the output of pip freeze:
- Flask-SocketIO==3.1.1
- python-engineio==2.3.2
- python-socketio==2.1.2`
Of course you are. You are now using an invalid dependencies. The 2.1.2 release requires python-engineio 3.0.0. The fix is to declare the correct dependencies, you have to let pip do its thing.
Okay. It is working now! Thank you!