Hi,
I have the following error

I have installed socketio using pip install and it using python version 2.7.12
I have checked the Server.py is also present in socketio module.
I have looked through previous issues which are similar but none have helped.
Please help!
What module did you install? This package is under python-socketio in the package repository.
Okay, so if anybody is facing the same issue, this is how I solved it-
I had installed socketio and python-socketio both. So it was not able to identify the module. I uninstalled socketio and it worked. Thank you for your reply miguelgrinberg.
Okay, so if anybody is facing the same issue, this is how I solved it-
I had installed socketio and python-socketio both. So it was not able to identify the module. I uninstalled socketio and it worked. Thank you for your reply miguelgrinberg.
Hi, It is not working for me! I tried this. Can anyone help?
I have the same problem:
AttributeError: module 'socketio' has no attribute 'AsyncServer'
I have only python-socketio installed.
@gouthamgandhi what's the output of pip freeze?
server ankuagra$ pip freeze
aiohttp==3.4.4
async-timeout==3.0.1
attrs==18.2.0
chardet==3.0.4
idna==2.7
idna-ssl==1.1.0
multidict==4.4.2
netifaces==0.10.6
pygame==1.9.4
python-engineio==2.3.2
python-socketio==2.0.0
six==1.11.0
socketio==0.1.4
yarl==1.2.6
Facing same issue. Tried removing socketio but still getting the same error.
server ankuagra$ python server.py
Traceback (most recent call last):
File "server.py", line 1, in
from aiohttp import web
ModuleNotFoundError: No module named 'aiohttp'
server ankuagra$
@agrawal-ankur it is a different issue, note that the error message is different. Are you sure your virtuale environment is activated? Looks like aiohttp was not found, which makes me think your virtualenv is not activated, or else you are using a different virtualenv by mistake.
Thanks for checking.
With python3, the error is :
server ankuagra$ python3 server.py
Traceback (most recent call last):
File "server.py", line 4, in
sio = socketio.AsyncServer()
AttributeError: module 'socketio' has no attribute 'AsyncServer'
server ankuagra$
@agrawal-ankur run pip uninstall socketio, as indicated by the OP.
python -m pip install aiohttp worked for me.
Sent from my iPhone
On 15-Oct-2018, at 9:52 PM, Miguel Grinberg notifications@github.com wrote:
@agrawal-ankur run pip uninstall socketio, as indicated by the OP.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
Another thing that can cause this is if you inadvertently named your file socket.py (or some other system library name). This overrides the system library causing weird failures (#264).
Hi everyone! I know the issue has been closed, but I would like to add something. I was facing the same problem, module module has no attribute server. the socketio was not installed in my virtual environment, only the python-socketio. Nor did I have a module with a case sensitive name. So what I did was to create a new virtual environment from scratch, install all the packets needed and run in there only the modules for that specific project. It solved the problem!
Same issue
Error :
sio = socketio.Server()
AttributeError: module 'socketio' has no attribute 'Server'
pip freeze output :
absl-py==0.11.0
aiohttp==3.7.3
argon2-cffi==20.1.0
asgiref==3.2.10
astunparse==1.6.3
async-generator==1.10
async-timeout==3.0.1
attrs==20.3.0
backcall==0.2.0
bidict==0.21.2
bleach==3.2.1
cachetools==4.2.0
certifi==2020.12.5
cffi==1.14.4
chardet==3.0.4
click==7.1.2
cycler==0.10.0
decorator==4.4.2
defusedxml==0.6.0
Django==3.0.7
django-extensions==3.0.2
dnspython==1.16.0
entrypoints==0.3
eventlet==0.30.0
Flask==1.1.2
Flask-SocketIO==5.0.1
flatbuffers==1.12
future==0.18.2
gast==0.3.3
google-auth==1.24.0
google-auth-oauthlib==0.4.2
google-pasta==0.2.0
graphviz==0.14
greenlet==1.0.0
grpcio==1.32.0
h5py==2.10.0
idna==2.10
ipykernel==5.4.2
ipython==7.19.0
ipython-genutils==0.2.0
ipywidgets==7.6.2
itsdangerous==1.1.0
jedi==0.18.0
Jinja2==2.11.2
jsonschema==3.2.0
jupyter==1.0.0
jupyter-client==6.1.7
jupyter-console==6.2.0
jupyter-core==4.7.0
jupyterlab-pygments==0.1.2
jupyterlab-widgets==1.0.0
Keras==2.4.3
Keras-Preprocessing==1.1.2
kiwisolver==1.3.1
Markdown==3.3.3
MarkupSafe==1.1.1
matplotlib==3.3.3
mistune==0.8.4
multidict==5.1.0
mysql-connector-python==8.0.20
nbclient==0.5.1
nbconvert==6.0.7
nbformat==5.0.8
nest-asyncio==1.4.3
netifaces==0.10.6
notebook==6.1.6
numpy==1.19.4
oauthlib==3.1.0
opencv-python==4.5.1.48
opt-einsum==3.3.0
packaging==20.8
pandocfilters==1.4.3
parso==0.8.1
pexpect==4.8.0
pickleshare==0.7.5
Pillow==8.1.0
prometheus-client==0.9.0
prompt-toolkit==3.0.8
protobuf==3.12.2
ptyprocess==0.7.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycparser==2.20
pydot==1.4.1
Pygments==2.7.3
pyparsing==2.4.7
pyrsistent==0.17.3
pytesseract==0.3.7
python-dateutil==2.8.1
python-engineio==4.0.0
python-socketio==5.0.4
pytz==2020.1
PyYAML==5.3.1
pyzmq==20.0.0
qtconsole==5.0.1
QtPy==1.9.0
requests==2.25.1
requests-oauthlib==1.3.0
rsa==4.6
scipy==1.6.0
Send2Trash==1.5.0
six==1.15.0
sqlparse==0.3.1
tensorboard==2.4.0
tensorboard-plugin-wit==1.7.0
tensorflow==2.4.0
tensorflow-estimator==2.4.0
termcolor==1.1.0
terminado==0.9.2
testpath==0.4.4
torch==1.5.1+cpu
torchvision==0.6.1+cpu
tornado==6.1
traitlets==5.0.5
typing-extensions==3.7.4.3
urllib3==1.26.2
wcwidth==0.2.5
webencodings==0.5.1
Werkzeug==1.0.1
widgetsnbextension==3.5.1
wrapt==1.12.1
yarl==1.6.3
@Yash0411 I don't know. Try recreating the virtualenv from scratch to remove any residue from something you may have installed previously.
Thanks @miguelgrinberg,
I have created a new Virtual Environment and now its working correctly.
I guess a different library was imported using the same import statement.
Most helpful comment
What module did you install? This package is under
python-socketioin the package repository.