Spyder won't launch when creating new environment with conda default packages (5.2.2 version) with errors like `ModuleNotFoundError: No module named 'PyQt5.QtWebKitWidgets'` and `qtpy.QtModuleNotInstalledError: The QtWebEngineWidgets module was not found. It must be installed separately as PyQtWebEngine.`
See original GitHub issueIssue Report Checklist
- [X ] Searched the issues page for similar reports
- [ X] Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
- [ X] Reproduced the issue after updating with
conda update spyder
(orpip
, if not using Anaconda) - Could not reproduce inside
jupyter qtconsole
(if console-related) - [X ] Tried basic troubleshooting (if a bug/error)
- [X ] Restarted Spyder
- [ X] Reset preferences with
spyder --reset
- [ X] Reinstalled the latest version of Anaconda
- [ X] Tried the other applicable steps from the Troubleshooting Guide
- Completed the Problem Description, Steps to Reproduce and Version sections below
Problem Description
I pip installed PyMuPDF in Spyder in the base Conda environment (I now know we shouldn’t use pip install in conda environment if we can avoid it). When that happened, I was unable to show any objects. Every object I read in, say for example, a pandas dataframe, wouldn’t be able to open. I would get an error saying, “the object is not picklable”. Since then, I’ve tried uninstalling and reinstalling anaconda, I’ve tried upgrading Spyder in the base environment, I’ve tried creating new environments with “conda create -n spyder-env -c conda-forge spyder”, I’ve tried resetting my base environment to the original version. In the base environment, I get stuck in debug mode everytime, and if I just run the script, I’m unable to open an object. In the new environment, I’m unable to launch spyder. I’ve tried everything i can find. I’m at my wits end, and I have no idea how to proceed. Please help.
What is the expected output? What do you see instead?
Paste Traceback/Error Below (if applicable) – When trying to open spyder from new environment (spyder-env) - not applicable for base environment.
Traceback (most recent call last): File “C:\Users\rstrott\Anaconda3\envs\spyder-env\lib\site-packages\qtpy\QtWebEngineWidgets.py”, line 21, in <module> from PyQt5.QtWebEngineWidgets import QWebEnginePage ModuleNotFoundError: No module named ‘PyQt5.QtWebEngineWidgets’
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File “C:\Users\rstrott\Anaconda3\envs\spyder-env\Scripts\spyder-script.py”, line 10, in <module> sys.exit(main()) File “C:\Users\rstrott\Anaconda3\envs\spyder-env\lib\site-packages\spyder\app\start.py”, line 233, in main from spyder.app import mainwindow File “C:\Users\rstrott\Anaconda3\envs\spyder-env\lib\site-packages\spyder\app\mainwindow.py”, line 57, in <module> from qtpy import QtWebEngineWidgets # analysis:ignore File “C:\Users\rstrott\Anaconda3\envs\spyder-env\lib\site-packages\qtpy\QtWebEngineWidgets.py”, line 28, in <module> from PyQt5.QtWebKitWidgets import QWebPage as QWebEnginePage ModuleNotFoundError: No module named ‘PyQt5.QtWebKitWidgets’
Versions
Note: For the base environment (that I really want to get working)
- Spyder version: 5.1.5
- Python version: 3.9.12
- Qt version: 5.9.7
- PyQt version: 2.0.1
- Operating System name/version: Windows 10
Dependencies
Mandatory:
atomicwrites >=1.2.0 : 1.4.0 (OK) chardet >=2.0.0 : 4.0.0 (OK) cloudpickle >=0.5.0 : 2.0.0 (OK) cookiecutter >=1.6.0 : 1.7.3 (OK) diff_match_patch >=20181111 : 20200713 (OK) intervaltree >=3.0.2 : 3.1.0 (OK) IPython >=7.6.0 : 8.3.0 (OK) jedi >=0.17.2;<0.19.0 : 0.18.1 (OK) jsonschema >=3.2.0 : 4.4.0 (OK) keyring >=17.0.0 : 23.4.0 (OK) nbconvert >=4.0 : 6.4.4 (OK) numpydoc >=0.6.0 : 1.2 (OK) paramiko >=2.4.0 : 2.8.1 (OK) parso >=0.7.0;<0.9.0 : 0.8.3 (OK) pexpect >=4.4.0 : 4.8.0 (OK) pickleshare >=0.4 : 0.7.5 (OK) psutil >=5.3 : 5.8.0 (OK) pygments >=2.0 : 2.11.2 (OK) pylint >=2.5.0;<2.10.0 : 2.9.6 (OK) pyls_spyder >=0.4.0 : 0.4.0 (OK) pylsp >=1.2.2;<1.3.0 : 1.2.4 (OK) pylsp_black >=1.0.0 : None (OK) qdarkstyle =3.0.2 : 3.0.2 (OK) qstylizer >=0.1.10 : 0.1.10 (OK) qtawesome >=1.0.2 : 1.0.3 (OK) qtconsole >=5.1.0 : 5.3.0 (OK) qtpy >=1.5.0 : 2.0.1 (OK) rtree >=0.9.7 : 0.9.7 (OK) setuptools >=49.6.0 : 61.2.0 (OK) sphinx >=0.6.6 : 4.4.0 (OK) spyder_kernels >=2.1.1;<2.2.0 : 2.1.3 (OK) textdistance >=4.2.0 : 4.2.1 (OK) three_merge >=0.1.1 : 0.1.1 (OK) watchdog >=0.10.3 : 2.1.6 (OK) zmq >=17 : 22.3.0 (OK)
Optional:
cython >=0.21 : 0.29.28 (OK) matplotlib >=2.0.0 : 3.5.1 (OK) numpy >=1.7 : 1.21.5 (OK) pandas >=1.1.1 : 1.4.2 (OK) scipy >=0.17.0 : 1.7.3 (OK) sympy >=0.7.3 : 1.10.1 (OK)
Issue Analytics
- State:
- Created a year ago
- Comments:13 (7 by maintainers)
Thanks a lot it worked fine for me ! I had the same error message while installing a new conda environnment . Whereas spyder was working perfectly fine on another env. And installing the ‘pyqtwebengine’ solved the problem for the new env.
The thing is that the latest Spyder release (5.3.3) is only available with the conda-forge channel so usually to get the latest release we suggest people to use the conda-forge channel (adding to the conda installation/env creation command a
-c conda-forge
). My comment pointing out the need to check if the conda-forge channel is being used comes from the experience that mixing conda channels usually is not the best/can cause problems so without knowing which channel is being used we need to be careful about suggestions to not mess up users’ environments.Regarding the issue here, checking a little bit more, seems like the problem with
pyqtwebengine
comes from the package definition for Spyder 5.2.2 lackingpyqtwebengine
as dependency on the default channel 🤔The command you provided should be enought to create an env with Spyder 5.2.2 without
pyqtwebengine
related issues (checked on Windows) 👍If you want, you could open an issue and PR regarding the commands (indeed I think that at least some note regarding conda channels management and the versions available could be worthy) in the Spyder docs repo at: https://github.com/spyder-ide/spyder-docs