简体   繁体   中英

Can't launch Spyder from Anaconda Navigator

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.

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

pip uninstall PyQt5

卸载PyQt5后解决

and then Spyder launched perfectly

Spyder 终于推出了

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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