Skip to content

Import Error Question? #222

Closed
Closed

Description

@datadidit

Hi,

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.

Activity

  1. miguelgrinberg commented on Apr 17, 2021

    @miguelgrinberg
    Owner

    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.

  2. datadidit commented on Apr 17, 2021

    @datadidit
    Author

    @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.

  3. changed the title [-]Import Error w/ Latest Release[/-] [+]Import Error Question?[/+] on Apr 17, 2021
  4. Repository owner locked and limited conversation to collaborators on Jun 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions