Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/301.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在CentOS7中,AttributeError:module';socketio';没有属性';服务器';_Python - Fatal编程技术网

Python 在CentOS7中,AttributeError:module';socketio';没有属性';服务器';

Python 在CentOS7中,AttributeError:module';socketio';没有属性';服务器';,python,Python,我有一个Django项目,我使用git推送到远程回购 我已在我的远程repo(远程服务器为CentOS7.2)中安装了python socketio,执行时: (venv_dist) xxx$ python3 manage.py runserver 我得到以下错误: AttributeError:模块“socketio”没有属性“Server” 但是,如果在本地repo中,我在本地repovenv中安装了pythonsocketio,我就可以执行python3manage.py runserv

我有一个Django项目,我使用git推送到远程回购

我已在我的远程repo(远程服务器为CentOS7.2)中安装了
python socketio
,执行时:

(venv_dist) xxx$ python3 manage.py runserver
我得到以下错误:

AttributeError:模块“socketio”没有属性“Server”

但是,如果在本地repo中,我在本地repo
venv
中安装了
pythonsocketio
,我就可以执行python3
manage.py runserver
success

为什么在远程我不能执行成功

相关代码为:

import os

from django.http import HttpResponse
import socketio

basedir = os.path.dirname(os.path.realpath(__file__))
sio = socketio.Server(async_mode=async_mode)
thread = None

编辑-1

# pip3 show python-socketio
Name: python-socketio
Version: 1.9.0
Summary: Socket.IO server
Home-page: http://github.com/miguelgrinberg/python-socketio/
Author: Miguel Grinberg
Author-email: miguelgrinberg50@gmail.com
License: MIT
Location: /home/lll/repo/myProject/venv_dist/lib/python3.5/site-packages
Requires: python-engineio, six
Required-by: 


你可以做的几件事

  • 检查所有库文件所在的站点包文件夹-我猜套接字和其他库将有.egg文件
  • 卸载所有相关库并重新安装
  • 确保安装一次。如果已经安装,则应始终使用upgrade命令

可能是socketio已经作为系统库安装。如果您使用socketio.\uuuu路径\uuuu它说它安装在哪里?另外,
socketio.\uuu版本\uu
返回什么?远程服务器上的
pip3 show python socketio
的输出是什么?