简体   繁体   English

Python 3.7.0 没有名为“PyQt5.QtWebEngineWidgets”的模块

[英]Python 3.7.0 No module named 'PyQt5.QtWebEngineWidgets'

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谢谢

It has been moved to a separated package.它已被移动到一个单独的包中。

Based on this answer and 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:如果您在卸载库时遇到问题,请转到您的 Python 文件夹,例如:

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.并手动删除 PyQt 文件夹,然后卸载所有内容并重新安装。

Make sure you have the latest Python version and upgraded your pip too确保您拥有最新的 Python 版本并升级您的 pip

对我来说,首先使用pip uninstall PyQtWebEngine然后使用pip install PyQtWebEngine重新安装解决了 Spyder 无法启动的问题。

我刚刚安装了旧版本的 pyqt5

pip install PyQt5==5.7.1

this is a problem with pyqt5.这是 pyqt5 的问题。 You can try:你可以试试:

pip install pyqt5==pyqt5.8

or same for conda或 conda 相同

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM