Python 3.7.0 没有名为“PyQt5.QtWebEngineWidgets”的模块
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/51154871/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Python 3.7.0 No module named 'PyQt5.QtWebEngineWidgets'
提问by michele
I have Python 3.7.0 and I installed PyQt5 with this command:
我有 Python 3.7.0,我用这个命令安装了 PyQt5:
pip install PyQt5
I have returned this error:
我已经返回了这个错误:
main.py", line 4, in <module>
from PyQt5.QtWebEngineWidgets import *
ModuleNotFoundError: No module named 'PyQt5.QtWebEngineWidgets'
In Eclipse I have this configuration:
在 Eclipse 中,我有这样的配置:
What may be wrong?
可能有什么问题?
Thanks
谢谢
回答by Namgyal Brisson
It has been moved to a separated package.
它已移至单独的包中。
Based on this answerand my own experience, Just execute in a terminal:
根据这个答案和我自己的经验,只需在终端中执行:
pip install PyQtWebEngine
If you still got problems with PyQt, try uninstalling all of the PyQt related libraries:
如果您仍然遇到 PyQt 问题,请尝试卸载所有 PyQt 相关库:
pip uninstall PyQt5
pip uninstall PyQt5-sip
pip uninstall PyQtWebEngine
Then install them again, which should fix the following errors:
然后再次安装它们,这应该修复以下错误:
ModuleNotFoundError: No module named 'PyQt5.sip'
ModuleNotFoundError: No module named 'PyQt5.QtWebEngineWidgets'
If you got problems uninstalling the libraries, go to your Python folder, like C:\Users\<USERNAME>\AppData\Local\Programs\Python\Python<PYTHON-VERSION>\Lib\site-packages
and manually delete the PyQt folders, then uninstall everything and install again. (Make sure you have the latest Python version and upgraded your pip too.)
如果您在卸载库时遇到问题,请转到您的 Python 文件夹,例如C:\Users\<USERNAME>\AppData\Local\Programs\Python\Python<PYTHON-VERSION>\Lib\site-packages
并手动删除 PyQt 文件夹,然后卸载所有内容并重新安装。(确保您拥有最新的 Python 版本并升级了您的 pip。)
回答by Suedpol
For me, first uninstallingPyQtWebEngine with
pip uninstall PyQtWebEngine
and then reinstallingwith
pip install PyQtWebEngine
solved the problem of Spyder not starting.
对我来说,先卸载PyQtWebEngine与
pip uninstall PyQtWebEngine
和再重新安装以
pip install PyQtWebEngine
解决Spyder的问题无法启动。
回答by wilk85
I have just installed older version of pyqt5
我刚刚安装了旧版本的 pyqt5
pip install PyQt5==5.7.1
回答by Devesh
this is problem with pyqt5 version you can try pip install pyqt5==pyqt5.8or same for conda , i think this can help
这是 pyqt5 版本的问题,您可以尝试pip install pyqt5==pyqt5.8或conda相同,我认为这会有所帮助