Python-socketio: "import socketio" fails with "AttributeError: module 'engineio' has no attribute 'WSGIApp'" with python-engineio==2.3.2

Created on 10 Dec 2018  路  4Comments  路  Source: miguelgrinberg/python-socketio

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.

Steps to reproduce

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"

Expected behavior

The last command (import socketio from Python) succeeds.

Actual behavior

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'

Notes

  • Installing 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.

Configuration

  • 64b Arch Linux, Python 3.7.1
  • pip freeze:
    python-engineio==2.3.2 python-socketio==2.1.1 six==1.12.0
bug

All 4 comments

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!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DevJhns picture DevJhns  路  8Comments

sdvcrx picture sdvcrx  路  3Comments

kamranhossain picture kamranhossain  路  7Comments

sraboncmc picture sraboncmc  路  5Comments

amckinley picture amckinley  路  3Comments