小编给大家分享一下重启宝塔面板后提示ModuleNotFoundError: No module named 'geventwebsocket'怎么办,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!
背景:
因服务器部署了flask项目,安装了python3,故重启宝塔面板报错
[Traceback (most recent call last):
File "/root/anaconda3/lib/python3.7/site-packages/gunicorn/util.py", line 135, in load_class
mod = import_module('.'.join(components))
File "/root/anaconda3/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'geventwebsocket'
]
------------------------------------------------------
Error: BT-Panel service startup failed.
解决办法:
1、python3安装geventwebsocket
我不想拆卸python3,也不想删除python3的软链接,所以在网上查到了此方法
仔细看了下好像是升级python3.7后缺少了geventwebsocket这个模块
那我尝试了下pip安装这个模块:
sudo pip3 install geventwebsocket
结果还是报错
2、继续安装gevent-websocket
sudo pip3 install gevent-websocket
安装之后还有报错,提示No module named 'paramiko'
3、继续安装paramiko
sudo pip3 install paramiko
4、接着重启宝塔面板
sudo /etc/init.d/bt
成功!!!
以上是“重启宝塔面板后提示ModuleNotFoundError: No module named 'geventwebsocket'怎么办”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注亿速云行业资讯频道!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。