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 with Qt 5.6 and Anaconda because of the lack of libselinux.so.1 #3383

Closed
idwaker opened this issue Aug 31, 2016 · 22 comments

Comments

@idwaker
Copy link

idwaker commented Aug 31, 2016

Description of your problem

Spyder unable to load due to import error in Linux 64bit.

Edit: This issue also existed on previous version 3.0.0b5.

What steps will reproduce the problem?

  1. create new conda environment

conda create -n spyder python
2. Install spyder

conda install -c qttesting qt pyqt
conda install -c spyder-ide spyder==3.0.0b6
3. Run spyder

spyder

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

Traceback (most recent call last):
  File "/home/idwaker/miniconda3/envs/spyder/lib/python3.5/site-packages/qtpy/QtWebEngineWidgets.py", line 22, in <module>
    from PyQt5.QtWebEngineWidgets import QWebEnginePage
ImportError: No module named 'PyQt5.QtWebEngineWidgets'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/idwaker/miniconda3/envs/spyder/bin/spyder", line 3, in <module>
    start.main()
  File "/home/idwaker/miniconda3/envs/spyder/lib/python3.5/site-packages/spyder/app/start.py", line 116, in main
    from spyder.app import mainwindow
  File "/home/idwaker/miniconda3/envs/spyder/lib/python3.5/site-packages/spyder/app/mainwindow.py", line 92, in <module>
    from qtpy import QtWebEngineWidgets  # analysis:ignore
  File "/home/idwaker/miniconda3/envs/spyder/lib/python3.5/site-packages/qtpy/QtWebEngineWidgets.py", line 26, in <module>
    from PyQt5.QtWebKitWidgets import QWebPage as QWebEnginePage
ImportError: libselinux.so.1: cannot open shared object file: No such file or directory

Please provide any additional information below

while using python 2, has same results

Traceback (most recent call last):
  File "/home/idwaker/miniconda3/envs/spyder-py2/bin/spyder", line 3, in <module>
    start.main()
  File "/home/idwaker/miniconda3/envs/spyder-py2/lib/python2.7/site-packages/spyder/app/start.py", line 116, in main
    from spyder.app import mainwindow
  File "/home/idwaker/miniconda3/envs/spyder-py2/lib/python2.7/site-packages/spyder/app/mainwindow.py", line 92, in <module>
    from qtpy import QtWebEngineWidgets  # analysis:ignore
  File "/home/idwaker/miniconda3/envs/spyder-py2/lib/python2.7/site-packages/qtpy/QtWebEngineWidgets.py", line 26, in <module>
    from PyQt5.QtWebKitWidgets import QWebPage as QWebEnginePage
ImportError: libselinux.so.1: cannot open shared object file: No such file or directory

Versions and main components

  • Spyder Version: 3.0.0b6
  • Python Version: 2.7 and 3.5
  • Operating system: Linux 64bit with Miniconda

Dependencies

output of conda list
# packages in environment at /home/idwaker/miniconda3/envs/spyder:
#
alabaster                 0.7.8                    py35_0  
astroid                   1.4.4                    py35_0  
babel                     2.3.3                    py35_0  
cairo                     1.12.18                       6  
decorator                 4.0.10                   py35_0  
docutils                  0.12                     py35_2  
entrypoints               0.2.2                    py35_0  
expat                     2.1.0                         0  
fontconfig                2.11.1                        6  
freetype                  2.5.5                         1  
glib                      2.43.0                        1  
harfbuzz                  0.9.39                        1  
icu                       54.1                          0  
imagesize                 0.7.1                    py35_0  
ipykernel                 4.4.1                    py35_0  
ipython                   5.1.0                    py35_0  
ipython_genutils          0.1.0                    py35_0  
jedi                      0.9.0                    py35_1  
jinja2                    2.8                      py35_1  
jpeg                      8d                            1  
jsonschema                2.5.1                    py35_0  
jupyter_client            4.3.0                    py35_0  
jupyter_core              4.1.1                    py35_0  
lazy-object-proxy         1.2.1                    py35_0  
libffi                    3.2.1                         0  
libgcc                    5.2.0                         0  
libpng                    1.6.22                        0  
libsodium                 1.0.10                        0  
libxml2                   2.9.2                         0  
logilab-common            1.0.2                    py35_0  
markupsafe                0.23                     py35_2  
mistune                   0.7.2                    py35_0  
nbconvert                 4.2.0                    py35_0  
nbformat                  4.0.1                    py35_0  
openssl                   1.0.2h                        1  
pango                     1.39.0                        1  
path.py                   8.2.1                    py35_0  
pep8                      1.7.0                    py35_0  
pexpect                   4.0.1                    py35_0  
pickleshare               0.7.3                    py35_0  
pip                       8.1.2                    py35_0  
pixman                    0.32.6                        0  
prompt_toolkit            1.0.3                    py35_0  
psutil                    4.3.0                    py35_0  
ptyprocess                0.5.1                    py35_0  
pyflakes                  1.2.3                    py35_0  
pygments                  2.1.3                    py35_0  
pylint                    1.5.4                    py35_0  
python                    3.5.2                         0  
pytz                      2016.6.1                 py35_0  
pyzmq                     15.4.0                   py35_0  
qtawesome                 0.3.3                    py35_0  
qtconsole                 4.2.1                    py35_0  
dbus                      1.11.2                        3    qttesting
gst-plugins-base          1.8.0                         0    qttesting
gstreamer                 1.8.0                         0    qttesting
libxcb                    1.11.1                        0    qttesting
pyqt                      5.6.0                    py35_0    qttesting
qt                        5.6.0                         0    qttesting
readline                  6.2                           2  
rope                      0.9.4                    py35_1  
setuptools                25.1.6                   py35_0  
simplegeneric             0.8.1                    py35_1  
six                       1.10.0                   py35_0  
snowballstemmer           1.2.1                    py35_0  
sphinx                    1.4.1                    py35_0  
sphinx_rtd_theme          0.1.9                    py35_0  
qtpy                      1.1.1                      py_0    spyder-ide
sip                       4.18                     py35_0    spyder-ide
spyder                    3.0.0b6                  py35_1    spyder-ide
sqlite                    3.13.0                        0  
tk                        8.5.18                        0  
tornado                   4.4.1                    py35_0  
traitlets                 4.2.2                    py35_0  
wcwidth                   0.1.7                    py35_0  
wheel                     0.29.0                   py35_0  
wrapt                     1.10.6                   py35_0  
xz                        5.2.2                         0  
zeromq                    4.1.4                         0  
zlib                      1.2.8                         3  
@ccordoba12
Copy link
Member

Thanks for reporting. This error happens because libQt5WebKit.so depends on libselinux.so.1 and you don't have it installed in your system (that library is not provided by Anaconda).

I don't know what Linux distro you're using, but in Ubuntu you can run

sudo apt-get install libselinux1

to install it.


@mingwandroid, why Webkit ends up compiled against selinux? I checked other Qt libraries (e.g. QtWidgets) and they don't have that dependency :-)

@ccordoba12 ccordoba12 changed the title Import Error with QtWebEngineWidgets, Spyder 3.0.0b6 with Qt 5.6 using Miniconda for Linux Spyder fails to start on Linux because of the lack of libselinux.so.1 Aug 31, 2016
@ccordoba12 ccordoba12 changed the title Spyder fails to start on Linux because of the lack of libselinux.so.1 Spyder fails to start on Linux with Qt 5.6 and Anaconda because of the lack of libselinux.so.1 Aug 31, 2016
@mingwandroid
Copy link

mingwandroid commented Sep 1, 2016

I'm not sure why. I'll have to look into it. Is it possible to assign this issue to me?

@ethankruse
Copy link

ethankruse commented Sep 19, 2016

Any update on a fix for this? I recently updated all my conda packages and this popped up. I had to revert back to the old qt and pyqt for now in order to use Spyder, but I'd like to update everything soon.

I should also note that I'm on a system without root access so I can't sudo or install general things outside of the scope of conda/pip.

@mingwandroid
Copy link

mingwandroid commented Sep 19, 2016

WebKit links to selinux to allow requesting WX (write and execute) pages. Without this it cannot use JIT.

Exactly which Linux mint are you using? Is there any reason why you didn't select selinux at install time? Even centos5 has selinux.

I can disable JIT but it will slow down all apps using QtWebkit which is going to be most of the big ones.

@ethankruse
Copy link

Hm, never mind. This isn't the error I'm getting at this point. I can open another issue if you want, but the error I get (on both my Linux and Mac) is:

Traceback (most recent call last):
File "/Users/ekruse/anaconda/bin/spyder", line 3, in <module>
start_app.main()
File "/Users/ekruse/anaconda/lib/python2.7/site-packages/spyderlib/start_app.py", line 114, in main
from spyderlib import spyder
File "/Users/ekruse/anaconda/lib/python2.7/site-packages/spyderlib/spyder.py", line 48, in <module>
requirements.check_qt()
File "/Users/ekruse/anaconda/lib/python2.7/site-packages/spyderlib/requirements.py", line 50, in check_qt
% (qt_infos['pyqt']+qt_infos['pyside']))
File "/Users/ekruse/anaconda/lib/python2.7/site-packages/spyderlib/requirements.py", line 25, in show_warning
raise RuntimeError(message)
RuntimeError: Please check Spyder installation requirements:
PyQt4 4.6+ (or PySide 1.2.0+) is required.

Presumably because you now need to do import PyQt5 instead of PyQt4...

@mingwandroid
Copy link

Well, currently things are a little in-flux. I still must determine why you had trouble with selinux and whether it is going to present a problem for the upcoming release. I'd appreciate the details of your Linux Mint version if possible.

@ccordoba12
Copy link
Member

@ethankruse, this problem is caused by an update in qtpy. We're working to fix it right now :-)

@ccordoba12
Copy link
Member

I meant your problem :-)

@mingwandroid
Copy link

@ethankruse any chance of giving me exact version numbers of your Mint install? I'd also like to know what packages you have installed if possible (via dpkg --get-selections I believe).

@ethankruse
Copy link

Wait sorry @mingwandroid is this about the selinux issue? I'm not having that. I jumped into the thread assuming my qt5* problem was the same, but apparently didn't read the exact error message closely enough. Sounds like @ccordoba12 has my problem under control.

@mingwandroid
Copy link

Ah yes, I see now. @idwaker, I'd like to ask you those same questions then.

@ccordoba12
Copy link
Member

@ethankruse, please don't pollute our issues for the next time (the title of this issue is quite clear about selinux :-)

After re-reading your last error, I think your problem has to do with incorrect declared dependencies of pyqt on qt. It's currently fixed by Continuum.

@idwaker
Copy link
Author

idwaker commented Sep 25, 2016

@mingwandroid this issue occurred in Solus (1.2.0.5), which i guess didn't have any libselinux related packages ( in its repository ).

@ccordoba12
Copy link
Member

@idwaker, it's hard for Continuum to support every Linux distro under the sun :-)

And as @mingwandroid said:

WebKit links to selinux to allow requesting WX (write and execute) pages. Without this it cannot use JIT.

selinux is very important to have a fast rendering Qt Webkit module ;-)

@MarkCWirt
Copy link

MarkCWirt commented Oct 3, 2016

This bit me this AM on Arch Linux, and I wanted to make a note for Arch users that while selinux 1 is not available on arch, installing selinux 2.5 from the Arch User Repository appears to resolve the issue (in other words it boots up but I haven't used it extensively yet).

@ccordoba12
Copy link
Member

Unfortunately this won't change in the future. Without linking to selinux QtWebkit looses JIT capabilities, meaning that it'd be quite slow.

@SvenGeier
Copy link

If "this won't change in the future", why did it change in the recent past? I've never needed selinux to launch spyder all the way through Anaconda4.1.1 (Spyder 2.3.9, Python 3.5.2 64bits, Qt 4.8.7, PyQt4 (API v2) 4.11.4 on Linux). Yet starting with 4.2 this is suddenly absolutely required because Qt5?
This seems like a step backwards...
(All my production machines run slackware, for which there is no selinux. Neither for SuSE. Are you seriously committing development to a path that cuts out major Linux distributions forever?)

@mingwandroid
Copy link

mingwandroid commented Nov 30, 2016

Our Qt4 builds did not have a QtWebkit with JIT enabled, our Qt5 builds do as that was enabled later by The Qt Project. Spyder and particularly RStudio are unusably slow without JIT.

In terms of whether we can do anything about it, it's a cost-benefits calculation. It may be possible for us to build an selinux library for such distros (but IMHO if they want to take their users' security seriously they should implement selinux).

All my production machines run slackware, for which there is no selinux.

From https://distrowatch.com/dwres.php?resource=popularity slackware is not popular and is dropping down the popularity charts rapidly.

Neither for SuSE

I tested RStudio, Spyder and QtCreator on openSUSE tumbleweed. selinux is available there: https://en.opensuse.org/SDB:SELinux

@ccordoba12
Copy link
Member

Yet starting with 4.2 this is suddenly absolutely required because Qt5?

Yes, that's mainly the problem. Qt5 demands now to have libselinux for QtWebkit's Javascript JIT compilation. However, that's how Continuum created packages for it, and I think they're thinking to include a libselinux package in a future release (maybe Anaconda 4.3).

Are you seriously committing development to a path that cuts out major Linux distributions forever?

You can still install Spyder and PyQt5 with pip instead of with Anaconda/Miniconda. However, that has its problems too, like #3520.

@ccordoba12
Copy link
Member

Closing, as this is not something we can solve in Spyder.

@msiraj83
Copy link

msiraj83 commented Nov 7, 2017

Facing the same problem.. can any body help..

Thanks

@ccordoba12
Copy link
Member

ccordoba12 commented Nov 7, 2017 via email

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

7 participants