67

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

6
  • Your system is 32 bits? Commented Jul 3, 2018 at 12:42
  • 1
    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. Commented Jul 3, 2018 at 12:43
  • 1
    Use a final version of Python to solve this problem. Commented Jul 3, 2018 at 13:56
  • which kind of python version I have to install for install with pip all the requirements? Commented Jul 3, 2018 at 17:53
  • Having the same issue - does this mean that the 32 Bit Windows doesn't come with QtWebEngineWidgets when installing PyQt? Commented Aug 15, 2018 at 3:50

6 Answers 6

120

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
Sign up to request clarification or add additional context in comments.

6 Comments

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.
Thanks, this worked for me on Manjaro 64 bit, with a PyQt 5.12.1 installed via pip
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
...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]
For PyQt6 the package is renamed to PyQt6-WebEngine
|
10

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

Comments

3

I have just installed older version of pyqt5

pip install PyQt5==5.7.1

Comments

3

this is a problem with pyqt5. You can try:

pip install pyqt5==pyqt5.8

or same for conda

Comments

2

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

Comments

1

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.