Hello. So I recently started using SocketIO in my facial recognition system to get the current webcam status and send the modified webcam feed (after the facial recognition process) back to the client. However, I’ve had a problem with my WSGI file. (The WSGI code is:
import sys
from flask_socketio import SocketIO as socketio
sys.path.insert(0, ‘/home/Cryptic02/mysite’)
from facialrecognition import app as application
application = socketio.WSGIApp(application)
socketio.init_app(application)
Whenever I try to use it, it gives me the error:
2023-05-31 11:21:13,800: Error running WSGI application
2023-05-31 11:21:13,810: ImportError: cannot import name 'Namespace' from 'socketio' (/home/Cryptic02/.local/lib/python3.10/site-packages/socketio/__init__.py)
2023-05-31 11:21:13,811: File "/var/www/cryptic02_pythonanywhere_com_wsgi.py", line 2, in <module>
2023-05-31 11:21:13,811: from flask_socketio import SocketIO as socketio
2023-05-31 11:21:13,811:
2023-05-31 11:21:13,811: File "/home/Cryptic02/.local/lib/python3.10/site-packages/flask_socketio/__init__.py", line 26, in <module>
2023-05-31 11:21:13,811: from .namespace import Namespace
2023-05-31 11:21:13,812:
2023-05-31 11:21:13,812: File "/home/Cryptic02/.local/lib/python3.10/site-packages/flask_socketio/namespace.py", line 1, in <module>
2023-05-31 11:21:13,812: from socketio import Namespace as _Namespace
I have uninstalled and reinstalled SocketIO but it doesn’t fix the problem. Is this a problem in my code, or does PythonAnywhere not support SocketIO? Many thanks.
[edit by admin: formatting]