Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spyder fails to start on Linux #6990

Closed
ridhi1412 opened this issue Apr 19, 2018 · 20 comments
Closed

Spyder fails to start on Linux #6990

ridhi1412 opened this issue Apr 19, 2018 · 20 comments

Comments

@ridhi1412
Copy link

Problem Description

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:
#3383 (#3383)
#3145 (#3145)

but according to those, this issue was fixed in spyder 3.0 and up... so i am not sure what i am doing wrong..

What steps will reproduce the problem?

  1. Trying to run spyder
    spyder

What is the expected output? What do you see instead?

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/Error Below (if applicable)

PASTE TRACEBACK HERE

Package Versions

  • Spyder: 3.2.6
  • Python: 3.6.4
  • Qt: 5.6.2
  • PyQt: 5.6.0
  • Operating System: 4.4.0-112-generic GNU/Linux

Dependencies

PASTE DEPENDENCIES HERE
@ridhi1412
Copy link
Author

Based on some comments on the issues, i tried the following things as well:

  1. conda update qt5

"PackageNotInstalledError: Package is not installed in prefix.
prefix: /home/rmahajan14/anaconda3
package name: qt5"

  1. conda update qtpy - this works, and I get

" qtpy: 1.3.1-py36h3691cc8_0 --> 1.4.0-py36_0"

However, i still have this same issue

@ridhi1412
Copy link
Author

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'
"

@ccordoba12
Copy link
Member

ccordoba12 commented Apr 19, 2018

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?

@ridhi1412
Copy link
Author

I am sorry, but what do you man by headless server? How can i find out whether it is a headless server?

@ridhi1412
Copy link
Author

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'
"

@ridhi1412
Copy link
Author

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?

@ccordoba12
Copy link
Member

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.

@ridhi1412
Copy link
Author

@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 ! :)

@ccordoba12
Copy link
Member

ccordoba12 commented Apr 20, 2018

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.

@shaunster0
Copy link

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'

@YBrule
Copy link

YBrule commented Jul 4, 2018

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.

@ccordoba12
Copy link
Member

We don't support that kind of installation, sorry. So you're on your own.

@nabriis
Copy link

nabriis commented Aug 24, 2018

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)

@ssugrim
Copy link

ssugrim commented Sep 6, 2018

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

@VishalVaddina
Copy link

sudo apt-get install python-pyqt5.qtwebkit

Just checked; This also works for Ubuntu-18.04-LTS.

@A7medAbdeldaim
Copy link

For me, i had some conflicts in installing so i did:

  • pip uninstall spyder
  • apt remove spyder spyder3

then installing it again using apt:

  • apt-get install spyder3

It works.

@Russell-Jones-OxPhys
Copy link

Try
python3 -m pip install --upgrade PyQtWebEngine

@ivitan
Copy link

ivitan commented Apr 13, 2019

It work for me.
sudo pip install pyqt5==5.11.2

@JDYG
Copy link

JDYG commented Jul 16, 2019

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

@gussmith
Copy link

@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'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests