This is my first time trying to run flask on Linux, I've made projects 0 and 1 in Windows 7. I've been able to run Project 2 on Windows, right before I switched to Linux. As I enter "flask run" on the terminal, I get the following traceback.

Traceback (most recent call last):
  File "/usr/bin/flask", line 11, in <module>
    load_entry_point('Flask==0.12.2', 'console_scripts', 'flask')()
  File "/usr/lib/python3/dist-packages/flask/cli.py", line 513, in main
    cli.main(args=args, prog_name=name)
  File "/usr/lib/python3/dist-packages/flask/cli.py", line 380, in main
    return AppGroup.main(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args[1:], **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/flask/cli.py", line 423, in run_command
    app = DispatchingApp(info.load_app, use_eager_loading=eager_loading)
  File "/usr/lib/python3/dist-packages/flask/cli.py", line 152, in __init__
  File "/usr/lib/python3/dist-packages/flask/cli.py", line 176, in _load_unlocked
    self._app = rv = self.loader()
  File "/usr/lib/python3/dist-packages/flask/cli.py", line 237, in load_app
    rv = locate_app(self.app_import_path)
  File "/usr/lib/python3/dist-packages/flask/cli.py", line 90, in locate_app
  File "/home/yuri/yuriafgomes/application.py", line 4, in <module>
    from flask_socketio import SocketIO, emit
  File "/usr/lib/python3/dist-packages/flask_socketio/__init__.py", line 7, in <module>
    from socketio import socketio_manage
  File "/home/yuri/.local/lib/python3.6/site-packages/socketio/__init__.py", line 11, in <module>
    from .middleware import WSGIApp, Middleware
  File "/home/yuri/.local/lib/python3.6/site-packages/socketio/middleware.py", line 4, in <module>
    class WSGIApp(engineio.WSGIApp):
AttributeError: module 'engineio' has no attribute 'WSGIApp'

Searching for the error, I have found two related discussions:



Both date from 2018, and the solution to them was to upgrade python-engineio to version 3.0.0. So I get that this might have to do with the version of some packages. I have tried to force pip to install the same versions as the ones described in the first link, but to no avail. pip ends up installing the latest version of the packages. I have managed to install python-engineio 3.0.0, by running pip3 uninstall python-engineio and then pip3 install --no-cache-dir python-engineio==3.0.0 --global-option="--no-user-cfg". The same attribute error persists, though.

Using pip freeze, these are the versions of the relevant packages:





I'm using python 3.6.8 and Linux Mint 19.1 Cinnamon.

Does anyone know how to solve this? How can I make flask run again?

1 Answer 1


I've opened an issue on the github page for python-engineio and the owner helped me solve the issue. The application was loading and old version of engineio, and that's where the error was coming from (the old package in fact didn't have the WSGIApp module). I've uninstalled this package using pip3 uninstall python-engineio, then rebooted the system, then installed python-engineio again. Now flask is running as expected, with the latest versions of all dependencies.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .