Installed Anaconda on Ubuntu, and it was successful.
However, when i try to launch spyder, I get an error. It is related to PyQt5.
I noticed some issues related to the problem I am having:
but according to those, this issue was fixed in spyder 3.0 and up... so i am not sure what i am doing wrong..
I expect to see an spyder launched, instead i get this error:
"Traceback (most recent call last):
File "/home/rmahajan14/anaconda3/lib/python3.6/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 "/home/rmahajan14/anaconda3/bin/spyder", line 11, in
sys.exit(main())
File "/home/rmahajan14/anaconda3/lib/python3.6/site-packages/spyder/app/start.py", line 144, in main
from spyder.app import mainwindow
File "/home/rmahajan14/anaconda3/lib/python3.6/site-packages/spyder/app/mainwindow.py", line 92, in
from qtpy import QtWebEngineWidgets # analysis:ignore
File "/home/rmahajan14/anaconda3/lib/python3.6/site-packages/qtpy/QtWebEngineWidgets.py", line 26, in
from PyQt5.QtWebKitWidgets import QWebPage as QWebEnginePage
ImportError: libXrender.so.1: cannot open shared object file: No such file or directory
"
PASTE TRACEBACK HERE
PASTE DEPENDENCIES HERE
Based on some comments on the issues, i tried the following things as well:
"PackageNotInstalledError: Package is not installed in prefix.
prefix: /home/rmahajan14/anaconda3
package name: qt5"
" qtpy: 1.3.1-py36h3691cc8_0 --> 1.4.0-py36_0"
However, i still have this same issue
As a last resort, i did
"conda update --all"
My new versions are:
spyder 3.2.8
pyqt 5.9.2
qt 5.9.5
qtpy 1.4.0
I now get a different error related to QtWebEngineWidgets
"Traceback (most recent call last):
File "/home/rmahajan14/anaconda3/lib/python3.6/site-packages/qtpy/QtWebEngineWidgets.py", line 22, in
from PyQt5.QtWebEngineWidgets import QWebEnginePage
ImportError: libXcomposite.so.1: cannot open shared object file: No such file or directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/rmahajan14/anaconda3/bin/spyder", line 11, in
sys.exit(main())
File "/home/rmahajan14/anaconda3/lib/python3.6/site-packages/spyder/app/start.py", line 159, in main
from spyder.app import mainwindow
File "/home/rmahajan14/anaconda3/lib/python3.6/site-packages/spyder/app/mainwindow.py", line 92, in
from qtpy import QtWebEngineWidgets # analysis:ignore
File "/home/rmahajan14/anaconda3/lib/python3.6/site-packages/qtpy/QtWebEngineWidgets.py", line 26, in
from PyQt5.QtWebKitWidgets import QWebPage as QWebEnginePage
ModuleNotFoundError: No module named 'PyQt5.QtWebKitWidgets'
"
ImportError: libXrender.so.1: cannot open shared object file: No such file or directory
ImportError: libXcomposite.so.1: cannot open shared object file: No such file or directory
These errors seem to show that you don't have an X server installed. Are you trying to install Spyder in a headless server?
I am sorry, but what do you man by headless server? How can i find out whether it is a headless server?
I tried many things since then, and installed xterm too.
I now have the following errors:
"~ $ spyder
Traceback (most recent call last):
File "/home/rmahajan14/anaconda3/lib/python3.6/site-packages/qtpy/QtWebEngineWidgets.py", line 22, in
from PyQt5.QtWebEngineWidgets import QWebEnginePage
ImportError: libasound.so.2: cannot open shared object file: No such file or directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/rmahajan14/anaconda3/bin/spyder", line 11, in
sys.exit(main())
File "/home/rmahajan14/anaconda3/lib/python3.6/site-packages/spyder/app/start.py", line 159, in main
from spyder.app import mainwindow
File "/home/rmahajan14/anaconda3/lib/python3.6/site-packages/spyder/app/mainwindow.py", line 92, in
from qtpy import QtWebEngineWidgets # analysis:ignore
File "/home/rmahajan14/anaconda3/lib/python3.6/site-packages/qtpy/QtWebEngineWidgets.py", line 26, in
from PyQt5.QtWebKitWidgets import QWebPage as QWebEnginePage
ModuleNotFoundError: No module named 'PyQt5.QtWebKitWidgets'
"
Specifically, based on another similar issue which i was seeing, i had done this
"sudo apt-get install libsm6 libxrender1 libfontconfig1"
@ccordoba12
After that the libXrender disppeared, and I think now the error is basically that it is not finding 'PyQt5.QtWebKitWidgets' right?
I am sorry, but what do you man by headless server?
headless means a computer with no graphical facilities (i.e. no mouse, no windows, etc), just a console.
"sudo apt-get install libsm6 libxrender1 libfontconfig1"
If you had to install those libraries by hand, it means you didn't perform a regular Ubuntu desktop installation, which automatically installs them along with all the other system libraries needed by Spyder.
@rmahajan14, since this is not a problem with Spyder, but with the way you installed Ubuntu, I'm going to close this issue.
@ccordoba12 if you mean its a virtual machine, then yes, I have windows OS, so i created a virtual box for ubuntu.. I didnt think that would be a problem..
Just one last question - since i did install those 3 libraries and that error relating to that disappeared, isnt it true that the error i am getting now basically states that it is not finding 'PyQt5.QtWebKitWidgets' right? So, are you saying that this "QtWebKitWidgets" is also specific to ubuntu installation?
It seems to me from the error (in this line -> from PyQt5.QtWebEngineWidgets import QWebEnginePage) that the error is related to PyQt5 installation(which does come with anaconda)?
Thankyou for all your help ! :)
if you mean its a virtual machine
No, I didn't.
isnt it true that the error i am getting now basically states that it is not finding 'PyQt5.QtWebKitWidgets' right?
No, that's incorrect. Look at the error again:
ImportError: libasound.so.2: cannot open shared object file: No such file or directory
That means you're missing Alsa too.
Look, it's clear you don't know how Linux works. Simply remove your virtual machine and install a new one with all default options from the Ubuntu installer. Don't customize anything during installation, and then you'll get everything that Spyder needs to run.
I'm getting this issue too, trying to use spyder on bash for Windows (a.k.a. linux subsystem for windows). I did a default installation of Ubuntu on that, and get the errors
from PyQt5.QtWebEngineWidgets import QWebEnginePage
ImportError: libQt5WebEngineCore.so.5: cannot enable executable stack as shared object requires: Invalid argument
and
from PyQt5.QtWebKitWidgets import QWebPage as QWebEnginePage
ModuleNotFoundError: No module named 'PyQt5.QtWebKitWidgets'
Same issue with a Debian bash for Windows (Debian subsystem for Windows), same error, conda is up-to-date, qtpy too, I'm using Xming as X server for Windows which works for other applications.
We don't support that kind of installation, sorry. So you're on your own.
You are most likely missing many graphics related interfaces if you are running on a sub-system or docker container of ubunto etc.
I had similar issues and ended up installing the following
麓sudo apt-get install alsa'
for your particular issue.
I suggest installing 麓apt-file麓 using that to search for the missing files. Works many times (although not in this case)
For any one arriving here while trying to upgrade the pip installed version of spyder on an Ubuntu 16.04 Linux box the solution that worked for me was:
sudo apt-get install python-pyqt5.qtwebkit
sudo apt-get install python-pyqt5.qtwebkit
Just checked; This also works for Ubuntu-18.04-LTS.
For me, i had some conflicts in installing so i did:
then installing it again using apt:
It works.
Try
python3 -m pip install --upgrade PyQtWebEngine
It work for me.
sudo pip install pyqt5==5.11.2
I want to install spyder in a docker that based on pytorch/pytorch
. And I also confront this problem. I try many ways and finally fixed the problem. I think the steps may help you.
docker pull pytorch/pytorch # Ubuntu 16.04.5 LTS Python 3.6.6
conda install -c anaconda spyder #install spyder
apt update #
apt install libgl1-mesa-glx #fix that libGL.so.1: cannot open shared object file: No such file or directory
conda install pyqt=5.9.2 #I don't known why this version is 5.9.2 but it works
apt-get install python-pyqt5.qtwebkit
conda update -c conda-forge qt pyqt # this step is also important
@JDYG
I want to install spyder in a docker that based on
pytorch/pytorch
. And I also confront this problem. I try many ways and finally fixed the problem. I think the steps may help you.docker pull pytorch/pytorch # Ubuntu 16.04.5 LTS Python 3.6.6 conda install -c anaconda spyder #install spyder apt update # apt install libgl1-mesa-glx #fix that libGL.so.1: cannot open shared object file: No such file or directory conda install pyqt=5.9.2 #I don't known why this version is 5.9.2 but it works apt-get install python-pyqt5.qtwebkit conda update -c conda-forge qt pyqt # this step is also important
Thanks for the post, I had been looking for a solution to run Spyder inside a docker container based on NVIDIA Pytorch.
Unfortunately I followed all the steps listed, including downloading the docker pytorch/pytorch image, and I still get the error,
in addition to a missing library, which I will search:
$ spyder
Traceback (most recent call last):
File "/opt/conda/lib/python3.7/site-packages/qtpy/QtWebEngineWidgets.py", line 22, in
from PyQt5.QtWebEngineWidgets import QWebEnginePage
ImportError: libXss.so.1: cannot open shared object file: No such file or directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/conda/bin/spyder", line 11, in
sys.exit(main())
File "/opt/conda/lib/python3.7/site-packages/spyder/app/start.py", line 201, in main
from spyder.app import mainwindow
File "/opt/conda/lib/python3.7/site-packages/spyder/app/mainwindow.py", line 84, in
from qtpy import QtWebEngineWidgets # analysis:ignore
File "/opt/conda/lib/python3.7/site-packages/qtpy/QtWebEngineWidgets.py", line 26, in
from PyQt5.QtWebKitWidgets import QWebPage as QWebEnginePage
ModuleNotFoundError: No module named 'PyQt5.QtWebKitWidgets'
Most helpful comment
For any one arriving here while trying to upgrade the pip installed version of spyder on an Ubuntu 16.04 Linux box the solution that worked for me was:
sudo apt-get install python-pyqt5.qtwebkit