65

I have Python 3.7.0 and I installed PyQt5 with this command:

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:

enter image description here

What may be wrong?

Thanks

matthieu
  • 1,412
  • 1
  • 11
  • 33
michele
  • 26,348
  • 30
  • 111
  • 168
  • Your system is 32 bits? – eyllanesc Jul 03 '18 at 12:42
  • 1
    https://www.riverbankcomputing.com/software/pyqt/download5, Note that for v5.11 and later the 32-bit Windows wheels do not contain the WebEngine modules. and Wheels are provided for Python v3.5 and later for 64-bit Linux, macOS and 32-bit and 64-bit Windows. These include copies of the corresponding Qt libraries. – eyllanesc Jul 03 '18 at 12:43
  • 1
    Use a final version of Python to solve this problem. – Yaman Ahlawat Jul 03 '18 at 13:56
  • which kind of python version I have to install for install with pip all the requirements? – michele Jul 03 '18 at 17:53
  • Having the same issue - does this mean that the 32 Bit Windows doesn't come with QtWebEngineWidgets when installing PyQt? – Moe Aug 15 '18 at 03:50
  • I have the same issue too and I didn't find solution. Is there a solution that has been found? – YasserKhalil Nov 05 '18 at 06:21

6 Answers6

112

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:

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 have upgraded your pip too.

# install latest python version for your operating system, then
# upgrade pip:
pip install --upgrade pip

# uninstall everything
pip uninstall PyQt5
pip uninstall PyQt5-sip
pip uninstall PyQtWebEngine

# install everything
pip install PyQt5
pip install PyQt5-sip
pip install PyQtWebEngine
Gabriel Staples
  • 36,492
  • 15
  • 194
  • 265
Namgyal Brisson
  • 1,179
  • 1
  • 7
  • 14
  • 1
    It looks like the pip package for Spyder on Python 3.6 doesn't install this automatically for some reason, there might be a bug in that package since it seems like PyQtWebEngine is required for Spyder to run. – jrh Mar 11 '19 at 13:54
  • Thanks, this worked for me on Manjaro 64 bit, with a PyQt 5.12.1 installed via `pip` – Jason Apr 21 '19 at 12:17
  • `Command "/Users/admin/NoteMngr/bin/python /Users/admin/NoteMngr/lib/python3.7/site-packages/pip-19.0.3-py3.7.egg/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /var/folders/v8/hfj_m1rj2ss7b0zcfgsppz5m0000gn/T/tmpcs9lnxeb" failed with error code 1 in /private/var/folders/v8/hfj_m1rj2ss7b0zcfgsppz5m0000gn/T/pip-install-ou3rfj3r/PyQtWebEngine` – USERNAME GOES HERE Jun 27 '20 at 08:45
  • ...and don't forget to reboot the system after that! [same issue on Linux at least debian & manjaro and solved as in the answer + reboot] – cards Oct 04 '21 at 19:22
  • 3
    For PyQt6 the package is renamed to `PyQt6-WebEngine` – luciferchase Dec 30 '21 at 07:42
  • I had a problem uninstalling the packages, so I had to _remove the **dist-info** folder_ of PyQt5 and PyQtWebEngine from `/usr/lib/python3/dist-packages/` directory (for linux users) before I could reinstall the packages. – John Johnson Jan 20 '22 at 03:04
9

For me, first uninstalling PyQtWebEngine with pip uninstall PyQtWebEngine and then reinstalling with pip install PyQtWebEngine solved the problem of Spyder not starting.

Suedpol
  • 91
  • 1
  • 1
4

I have just installed older version of pyqt5

pip install PyQt5==5.7.1
eyllanesc
  • 235,170
  • 19
  • 170
  • 241
wilk85
  • 67
  • 10
3

this is a problem with pyqt5. You can try:

pip install pyqt5==pyqt5.8

or same for conda

Neuron
  • 5,141
  • 5
  • 38
  • 59
Devesh
  • 929
  • 12
  • 10
0

For PyQt6, these packages needs to be installed.

PyQt6==6.5.0
PyQt6-Qt6==6.5.0
PyQt6-sip==13.5.0
PyQt6-WebEngine==6.5.0
PyQt6-WebEngine-Qt6==6.5.0
Avinash Raj
  • 172,303
  • 28
  • 230
  • 274
0

Run your terminal as administrator and install pyqt5 and PyQtWebEngine from there, it usually works if you are using anaconda for example and if not installing in your current env.

python -m pip install PyQt5
python -m pip install PyQtWebEngine

You may need to import your module and submodules depending on your code.

from PyQt5 import QtWebEngineWidgets
from PyQt5.QtWebEngineWidgets import *

from PyQt5 import QtWidgets
from PyQt5.QtWidgets import *

If it doesn't work try to push up your current env in the windows env config and try to reinstall pyqt5 .

enter image description here