1

Three days ago I was playing around with Python, Mayavi and Jupyter Notebooks to create visualizations. This required to install PyQt5.

Due to constantly reaching memory errors, I've decided to test without using virtualenv's and installed the needed requirements on my local environment (which of course didn't solve).

After that, I was on my way to create visualizations using matplotlib and other Python libraries but can't launch Spyder from the Anaconda Navigator.

This is the error showing up

Traceback (most recent call last):
File "C:\Users\tiago\Anaconda3\lib\site-packages\qtpy\QtWebEngineWidgets.py", line 22, in 
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\tiago\Anaconda3\Scripts\spyder-script.py", line 10, in 
sys.exit(main())
File "C:\Users\tiago\Anaconda3\lib\site-packages\spyder\app\start.py", line 186, in main
from spyder.app import mainwindow
File "C:\Users\tiago\Anaconda3\lib\site-packages\spyder\app\mainwindow.py", line 90, in 
from qtpy import QtWebEngineWidgets # analysis:ignore
File "C:\Users\tiago\Anaconda3\lib\site-packages\qtpy\QtWebEngineWidgets.py", line 26, in 
from PyQt5.QtWebKitWidgets import QWebPage as QWebEnginePage
ModuleNotFoundError: No module named 'PyQt5.QtWebKitWidgets'

Edit: this is different than the looking like duplicate, that correct answer didn't even work in this case. In this case i had PyQt5 installed and that was the problem.

Tiago Martins Peres
  • 14,289
  • 18
  • 86
  • 145
  • 2
    Possible duplicate of [Can't start spyder because of PyQt5.QtWebKitWidgets](https://stackoverflow.com/questions/54869374/cant-start-spyder-because-of-pyqt5-qtwebkitwidgets) – Zoe Oct 12 '19 at 12:16
  • 1
    Read the edit, it's not the same neither is the correct answer. – Tiago Martins Peres Oct 12 '19 at 13:23
  • 1
    So post your answer there instead. It's the same question, we don't post a new question for each potential possible solution by design. Fragmenting questions and answers everywhere will make it harder to find real solutions. – Zoe Oct 12 '19 at 13:26
  • How are you defining if it's the same or not? – Tiago Martins Peres Oct 12 '19 at 13:28
  • Well, have you tried to other answer? It suggests a version issue, so have you tried installing that specific version it mentions to see if you still can run your application? And I would agree with Zoe, it is better to post your answer there instead. Spreading possible solutions to the same problem into different questions, just makes it harder for other persons to find possible fixes when they are researching their issue. One question with different solutions as its answers is more beneficial. – Tom Oct 12 '19 at 13:36
  • 1
    Yes i did and didn't solve. The problem wasn't about that. Here the problem appeared because PyQt5 was installed locally before installing Anaconda. Different context, similar error, different solutions. Not dup. – Tiago Martins Peres Oct 12 '19 at 13:40
  • *"the problem appeared because PyQt5 was installed locally before installing Anaconda"* When this is an important fact, then you could add this to the answer as well. – Tom Oct 12 '19 at 14:08
  • 2
    Yes, good idea, thank you again @Tom. https://stackoverflow.com/a/58355018/5675325 – Tiago Martins Peres Oct 12 '19 at 14:13
  • That answer is good in my opinion, but you should delete this question now. – Tom Oct 12 '19 at 14:22

3 Answers3

2

This problem had to do with the PyQt5 installation. The way to fix it was to uninstall it

pip uninstall PyQt5

Solved after uninstalling PyQt5

and then Spyder launched perfectly

Spyder finally launched

Tiago Martins Peres
  • 14,289
  • 18
  • 86
  • 145
1

The best way to solve the problem, is reinstalling the anaconda version. Here you can see all the versions:

https://repo.anaconda.com/archive/

I recommend: Anaconda3-2019.07-Windows-x86_64.exe

1

I had the same problem. I uninstalled Anaconda and then reinstalled the latest Anaconda and it works again. The downside is you need to install all the previous modules and packages again.

Kardi Teknomo
  • 1,375
  • 16
  • 24