You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We suddenly this morning started getting an Import Error stack trace from engineio:
/usr/local/lib/python3.7/site-packages/flask_socketio/__init__.py:21: in <module>
import socketio
/usr/local/lib/python3.7/site-packages/socketio/__init__.py:3: in <module>
from .client import Client
/usr/local/lib/python3.7/site-packages/socketio/client.py:11: in <module>
from . import packet
/usr/local/lib/python3.7/site-packages/socketio/packet.py:2: in <module>
from engineio import json as _json
E ImportError: cannot import name 'json' from 'engineio' (/usr/local/lib/python3.7/site-packages/engineio/__init__.py)
I was able to fix this by upgrading from Flask-Socketio 4.3.1 to 4.3.2 which I noticed has this requirement change which ensures we don't go to 5. Without that we'd hit latest version of socketio which is dependent on the latest version of engineio https://github.com/miguelgrinberg/python-socketio/blob/master/setup.py#L33 . Since this error just popped up and the release just recently came out 4/15 I believe the Import Error is related.
I'm not sure I follow your description of this problem. As far as I can see the dependencies between python-socketio and python-engineio are correct, and the latest release of the engineio package does have the json import. So the only way this error could have happened is if you upgraded socketio but did not upgrade engineio.
@miguelgrinberg thanks for getting back to me. Yeah we had engineio direct import that I also took out during that fix so that must've been it. My fault.
Activity
miguelgrinberg commentedon Apr 17, 2021
I'm not sure I follow your description of this problem. As far as I can see the dependencies between python-socketio and python-engineio are correct, and the latest release of the engineio package does have the
jsonimport. So the only way this error could have happened is if you upgraded socketio but did not upgrade engineio.datadidit commentedon Apr 17, 2021
@miguelgrinberg thanks for getting back to me. Yeah we had engineio direct import that I also took out during that fix so that must've been it. My fault.
[-]Import Error w/ Latest Release[/-][+]Import Error Question?[/+]