ContinuumIO / anaconda-issues

Anaconda issue tracking
646 stars 220 forks source link

Spyder fails to execute after qt update #9199

Open RinaldoB opened 6 years ago

RinaldoB commented 6 years ago

Actual Behavior

After updating packages with conda update --all I cannot start spyder anymore. It tries to import from PyQt5.QtWebKitWidgets which is not available.

Expected Behavior

Execution of spyder.

Steps to Reproduce

conda update --all spyder

Anaconda or Miniconda version:

5.1

Operating System:

Linux

conda info
     active environment : None
       user config file : /home/rinaldo/.condarc
 populated config files : /home/rinaldo/.condarc
          conda version : 4.5.1
    conda-build version : 3.8.1
         python version : 2.7.14.final.0
       base environment : /home/rinaldo/anaconda2  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/free/linux-64
                          https://repo.anaconda.com/pkgs/free/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/pro/linux-64
                          https://repo.anaconda.com/pkgs/pro/noarch
                          https://conda.anaconda.org/brian-team/linux-64
                          https://conda.anaconda.org/brian-team/noarch
                          https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : /home/rinaldo/anaconda2/pkgs
                          /home/rinaldo/.conda/pkgs
       envs directories : /home/rinaldo/anaconda2/envs
                          /home/rinaldo/.conda/envs
               platform : linux-64
             user-agent : conda/4.5.1 requests/2.18.4 CPython/2.7.14 Linux/3.2.0-4-amd64 debian/7 glibc/2.13
                UID:GID : 2492:600
             netrc file : None
           offline mode : False
conda list --show-channel-urls
# Name                    Version                   Build  Channel
_ipyw_jlab_nb_ext_conf    0.1.0            py27h08a7f0c_0    defaults
alabaster                 0.7.10           py27he5a193a_0    defaults
anaconda                  custom           py27h4a00acb_0    defaults
anaconda-client           1.6.14                   py27_0    defaults
anaconda-navigator        1.8.3                    py27_0    defaults
anaconda-project          0.8.2            py27h236b58a_0    defaults
asn1crypto                0.24.0                   py27_0    defaults
astroid                   1.6.3                    py27_0    defaults
astropy                   2.0.5            py27h3010b51_2    defaults
attrs                     17.4.0                   py27_0    defaults
babel                     2.5.3                    py27_0    defaults
backports                 1.0              py27h63c9359_1    defaults
backports.functools_lru_cache 1.5                      py27_1    defaults
backports.shutil_get_terminal_size 1.0.0            py27h5bc021e_2    defaults
backports_abc             0.5              py27h7b3c97b_0    defaults
beautifulsoup4            4.6.0            py27h3f86ba9_1    defaults
bitarray                  0.8.1            py27h14c3975_1    defaults
bkcharts                  0.2              py27h241ae91_0    defaults
blaze                     0.11.3           py27h5f341da_0    defaults
bleach                    2.1.3                    py27_0    defaults
bokeh                     0.12.15                  py27_0    defaults
boto                      2.48.0           py27h9556ac2_1    defaults
bottleneck                1.2.1            py27h21b16a3_0    defaults
brian2                    2.1.2           np113py27h568d706_0    brian-team
bsddb                     1.0                      py27_1    defaults
bzip2                     1.0.6                h9a117a8_4    defaults
ca-certificates           2018.03.07                    0    defaults
cairo                     1.14.12              h7636065_2    defaults
cdecimal                  2.3              py27h14c3975_3    defaults
certifi                   2018.1.18                py27_0    defaults
cffi                      1.11.5           py27h9745a5d_0    defaults
chardet                   3.0.4            py27hfa10054_1    defaults
click                     6.7              py27h4225b90_0    defaults
cloudpickle               0.5.2                    py27_1    defaults
clyent                    1.2.2            py27h7276e6c_1    defaults
colorama                  0.3.9            py27h5cde069_0    defaults
conda                     4.5.1                    py27_0    defaults
conda-build               3.8.1                    py27_0    defaults
conda-env                 2.6.0                h36134e3_1    defaults
conda-verify              2.0.0            py27hf052a9d_0    defaults
configparser              3.5.0            py27h5117587_0    defaults
contextlib2               0.5.5            py27hbf4c468_0    defaults
cryptography              2.2.2            py27h14c3975_0    defaults
curl                      7.59.0               h84994c4_0    defaults
cycler                    0.10.0           py27hc7354d3_0    defaults
cython                    0.28.2           py27h14c3975_0    defaults
cytoolz                   0.9.0.1          py27h14c3975_0    defaults
dask                      0.17.2                   py27_0    defaults
dask-core                 0.17.2                   py27_0    defaults
datashape                 0.5.4            py27hf507385_0    defaults
db                        5.3.28                        1    defaults
dbus                      1.13.2               h714fa37_1    defaults
decorator                 4.3.0                    py27_0    defaults
distributed               1.21.6                   py27_0    defaults
docutils                  0.14             py27hae222c1_0    defaults
entrypoints               0.2.3            py27h502b47d_2    defaults
enum34                    1.1.6            py27h99a27e9_1    defaults
et_xmlfile                1.0.1            py27h75840f5_0    defaults
expat                     2.2.5                he0dffb1_0    defaults
fastcache                 1.0.2            py27h14c3975_2    defaults
filelock                  3.0.4                    py27_0    defaults
flask                     0.12.2           py27h6d5c1cd_0    defaults
flask-cors                3.0.3            py27h1a8a27f_0    defaults
fontconfig                2.12.6               h49f89f6_0    defaults
freetype                  2.8                  hab7d2ae_1    defaults
fribidi                   1.0.2                h14c3975_0    defaults
funcsigs                  1.0.2            py27h83f16ab_0    defaults
functools32               3.2.3.2          py27h4ead58f_1    defaults
futures                   3.2.0            py27h7b459c0_0    defaults
get_terminal_size         1.0.0                haa9412d_0    defaults
gevent                    1.2.2            py27h475ea6a_0    defaults
glib                      2.56.1               h000015b_0    defaults
glob2                     0.6              py27hcea9cbd_0    defaults
gmp                       6.1.2                h6c8ec71_1    defaults
gmpy2                     2.0.8            py27h4cf3fa8_2    defaults
graphite2                 1.3.10               hf63cedd_1    defaults
greenlet                  0.4.13           py27h14c3975_0    defaults
grin                      1.2.1                    py27_4    defaults
gsl                       2.4                  h1bed415_3    defaults
gst-plugins-base          1.14.0               hbbd80ab_1    defaults
gstreamer                 1.14.0               hb453b48_1    defaults
h5py                      2.7.1            py27h2697762_0    defaults
harfbuzz                  1.7.6                h5f0a787_1    defaults
hdf5                      1.10.1               h9caa474_1    defaults
heapdict                  1.0.0                    py27_2    defaults
html5lib                  1.0.1            py27h5233db4_0    defaults
icu                       58.2                 h9c2bf20_1    defaults
idna                      2.6              py27h5722d68_1    defaults
imageio                   2.3.0                    py27_0    defaults
imagesize                 1.0.0                    py27_0    defaults
intel-openmp              2018.0.0                      8    defaults
ipaddress                 1.0.19                   py27_0    defaults
ipykernel                 4.8.2                    py27_0    defaults
ipython                   5.6.0                    py27_0    defaults
ipython_genutils          0.2.0            py27h89fb69b_0    defaults
ipywidgets                7.2.1                    py27_0    defaults
isort                     4.3.4                    py27_0    defaults
itsdangerous              0.24             py27hb8295c1_1    defaults
jbig                      2.1                  hdba287a_0    defaults
jdcal                     1.4                      py27_0    defaults
jedi                      0.11.1                   py27_1    defaults
jinja2                    2.10             py27h4114e70_0    defaults
jpeg                      9b                   h024ee3a_2    defaults
jsonschema                2.6.0            py27h7ed5aa4_0    defaults
jupyter                   1.0.0                    py27_4    defaults
jupyter_client            5.2.3                    py27_0    defaults
jupyter_console           5.2.0            py27hc6bee7e_1    defaults
jupyter_contrib_core      0.3.3                    py27_1    conda-forge
jupyter_contrib_nbextensions 0.5.0                    py27_0    conda-forge
jupyter_core              4.4.0            py27h345911c_0    defaults
jupyter_highlight_selected_word 0.2.0                    py27_0    conda-forge
jupyter_latex_envs        1.4.4                    py27_0    conda-forge
jupyter_nbextensions_configurator 0.4.0                    py27_0    conda-forge
jupyterlab                0.31.12                  py27_0    defaults
jupyterlab_launcher       0.10.5                   py27_0    defaults
kiwisolver                1.0.1            py27hc15e7b5_0    defaults
lazy-object-proxy         1.3.1            py27h682c727_0    defaults
libcurl                   7.59.0               h1ad7b7a_0    defaults
libedit                   3.1                  heed3624_0    defaults
libffi                    3.2.1                hd88cf55_4    defaults
libgcc                    7.2.0                h69d50b8_2    defaults
libgcc-ng                 7.2.0                hdf63c60_3    defaults
libgfortran-ng            7.2.0                hdf63c60_3    defaults
libpng                    1.6.34               hb9fc6fc_0    defaults
libsodium                 1.0.16               h1bed415_0    defaults
libssh2                   1.8.0                h9cfc8f7_4    defaults
libstdcxx-ng              7.2.0                hdf63c60_3    defaults
libtiff                   4.0.9                h28f6b97_0    defaults
libtool                   2.4.6                h544aabb_3    defaults
libxcb                    1.13                 h1bed415_1    defaults
libxml2                   2.9.8                hf84eae3_0    defaults
libxslt                   1.1.32               h1312cb7_0    defaults
llvmlite                  0.22.0           py27hdbca893_0    defaults
locket                    0.2.0            py27h73929a2_1    defaults
lxml                      4.2.1            py27h23eabaa_0    defaults
lzo                       2.10                 h49e0be7_2    defaults
markupsafe                1.0              py27h97b2822_1    defaults
matplotlib                2.2.2            py27h0e671d2_1    defaults
mccabe                    0.6.1            py27h0e7c7be_1    defaults
mistune                   0.8.3                    py27_0    defaults
mkl                       2018.0.2                      1    defaults
mkl-service               1.1.2            py27hb2d42c5_4    defaults
mkl_fft                   1.0.1            py27h3010b51_0    defaults
mkl_random                1.0.1            py27h629b387_0    defaults
more-itertools            4.1.0                    py27_0    defaults
mpc                       1.0.3                hec55b23_5    defaults
mpfr                      3.1.5                h11a74b3_2    defaults
mpmath                    1.0.0            py27h9669132_2    defaults
msgpack-python            0.5.6            py27h6bb024c_0    defaults
multipledispatch          0.5.0                    py27_0    defaults
navigator-updater         0.1.0            py27h0f9cd39_0    defaults
nbconvert                 5.3.1            py27he041f76_0    defaults
nbformat                  4.4.0            py27hed7f2b2_0    defaults
ncurses                   6.0                  h9df7e31_2    defaults
networkx                  2.1                      py27_0    defaults
nltk                      3.2.5            py27hec5f4de_0    defaults
nose                      1.3.7            py27heec2199_2    defaults
notebook                  5.4.1                    py27_0    defaults
numba                     0.37.0          np113py27h18d2f7f_0    defaults
numexpr                   2.6.4            py27hd318778_0    defaults
numpy                     1.13.3           py27hdbf6ddf_4    defaults
numpydoc                  0.8.0                    py27_0    defaults
odo                       0.5.1            py27h9170de3_0    defaults
olefile                   0.45.1                   py27_0    defaults
openpyxl                  2.5.2                    py27_0    defaults
openssl                   1.0.2o               h20670df_0    defaults
packaging                 17.1                     py27_0    defaults
pandas                    0.22.0           py27hf484d3e_0    defaults
pandoc                    1.19.2.1             hea2e7c5_1    defaults
pandocfilters             1.4.2            py27h428e1e5_1    defaults
pango                     1.41.0               hd475d92_0    defaults
parso                     0.1.1            py27h718acc2_0    defaults
partd                     0.3.8            py27h4e55004_0    defaults
patchelf                  0.9                  hf79760b_2    defaults
path.py                   11.0.1                   py27_0    defaults
pathlib2                  2.3.0            py27h6e9d198_0    defaults
patsy                     0.5.0                    py27_0    defaults
pcre                      8.42                 h439df22_0    defaults
pep8                      1.7.1                    py27_0    defaults
pexpect                   4.5.0                    py27_0    defaults
pickleshare               0.7.4            py27h09770e1_0    defaults
pillow                    5.1.0            py27h3deb7b8_0    defaults
pip                       9.0.3                    py27_0    defaults
pixman                    0.34.0               hceecf20_3    defaults
pkginfo                   1.4.2                    py27_1    defaults
pluggy                    0.6.0            py27h1f4f128_0    defaults
ply                       3.11                     py27_0    defaults
prompt_toolkit            1.0.15           py27h1b593e1_0    defaults
psutil                    5.4.5            py27h14c3975_0    defaults
ptyprocess                0.5.2            py27h4ccb14c_0    defaults
py                        1.5.3                    py27_0    defaults
py-cpuinfo                3.2.0                    py27_0    brian-team
pycairo                   1.15.4           py27h1b9232e_1    defaults
pycodestyle               2.4.0                    py27_0    defaults
pycosat                   0.6.3            py27ha4109ae_0    defaults
pycparser                 2.18             py27hefa08c5_1    defaults
pycrypto                  2.6.1            py27h14c3975_7    defaults
pycurl                    7.43.0.1         py27hb7f436b_0    defaults
pyflakes                  1.6.0            py27h904a57d_0    defaults
pygments                  2.2.0            py27h4a8b6f5_0    defaults
pylint                    1.8.4                    py27_0    defaults
pyodbc                    4.0.23           py27hf484d3e_0    defaults
pyopenssl                 17.5.0           py27hcee3be0_0    defaults
pyparsing                 2.2.0            py27hf1513f8_1    defaults
pyqt                      5.9.2            py27h751905a_0    defaults
pysocks                   1.6.8                    py27_0    defaults
pytables                  3.4.2            py27h1f7bffc_2    defaults
pytest                    3.5.0                    py27_0    defaults
python                    2.7.14              h1571d57_31    defaults
python-dateutil           2.7.2                    py27_0    defaults
pytz                      2018.4                   py27_0    defaults
pywavelets                0.5.2            py27hecda097_0    defaults
pyyaml                    3.12             py27h2d70dd7_1    defaults
pyzmq                     17.0.0           py27h14c3975_1    defaults
qt                        5.9.5                h7e424d6_0    defaults
qtawesome                 0.4.4            py27hd7914c3_0    defaults
qtconsole                 4.3.1            py27hc444b0d_0    defaults
qtpy                      1.4.0                    py27_0    defaults
readline                  7.0                  ha6073c6_4    defaults
requests                  2.18.4           py27hc5b0589_1    defaults
rope                      0.10.7           py27hfe459b0_0    defaults
ruamel_yaml               0.15.35          py27h14c3975_1    defaults
scandir                   1.7              py27h14c3975_0    defaults
scikit-image              0.13.1           py27h14c3975_1    defaults
scikit-learn              0.19.1           py27h445a80a_0    defaults
scipy                     1.0.1            py27hfc37229_0    defaults
seaborn                   0.8.1            py27h633ea1e_0    defaults
send2trash                1.5.0                    py27_0    defaults
setuptools                39.0.1                   py27_0    defaults
simplegeneric             0.8.1                    py27_2    defaults
singledispatch            3.4.0.3          py27h9bcb476_0    defaults
sip                       4.19.8           py27hf484d3e_0    defaults
six                       1.11.0           py27h5f960f1_1    defaults
snowballstemmer           1.2.1            py27h44e2768_0    defaults
sortedcollections         0.6.1                    py27_0    defaults
sortedcontainers          1.5.9                    py27_0    defaults
sphinx                    1.7.2                    py27_0    defaults
sphinxcontrib             1.0              py27h1512b58_1    defaults
sphinxcontrib-websupport  1.0.1            py27hf906f22_1    defaults
spyder                    3.2.8                    py27_0    defaults
sqlalchemy                1.2.6            py27h14c3975_0    defaults
sqlite                    3.22.0               h1bed415_0    defaults
ssl_match_hostname        3.5.0.1          py27h4ec10b9_2    defaults
statsmodels               0.8.0            py27hc87d62d_0    defaults
subprocess32              3.2.7            py27h373dbce_0    defaults
sympy                     1.1.1            py27hc28188a_0    defaults
tblib                     1.3.2            py27h51fe5ba_0    defaults
terminado                 0.8.1                    py27_1    defaults
testpath                  0.3.1            py27hc38d2c4_0    defaults
tk                        8.6.7                hc745277_3    defaults
toolz                     0.9.0                    py27_0    defaults
tornado                   5.0.1                    py27_1    defaults
traitlets                 4.3.2            py27hd6ce930_0    defaults
typing                    3.6.4                    py27_0    defaults
unicodecsv                0.14.1           py27h5062da9_0    defaults
unixodbc                  2.3.6                h1bed415_0    defaults
urllib3                   1.22             py27ha55213b_0    defaults
wcwidth                   0.1.7            py27h9e3e1ab_0    defaults
weave                     0.15.0                   py27_0    brian-team
webencodings              0.5.1            py27hff10b21_1    defaults
werkzeug                  0.14.1                   py27_0    defaults
wheel                     0.31.0                   py27_0    defaults
widgetsnbextension        3.2.0                    py27_0    defaults
wrapt                     1.10.11          py27h04f6869_0    defaults
xlrd                      1.1.0            py27ha77178f_1    defaults
xlsxwriter                1.0.4                    py27_0    defaults
xlwt                      1.3.0            py27h3d85d97_0    defaults
xz                        5.2.3                h55aa19d_2    defaults
yaml                      0.1.7                had09818_2    defaults
zeromq                    4.2.5                h439df22_0    defaults
zict                      0.1.3            py27h12c336c_0    defaults
zlib                      1.2.11               ha838bed_2    defaults
RinaldoB commented 6 years ago

Probably related: https://github.com/conda-forge/pyqt-feedstock/issues/19

mingwandroid commented 6 years ago

It is very unlikely to be related since that issue is very old and Qt 5.9 is very new.

What do you see from the command line if you run spyder? What OS are you running exactly?

RinaldoB commented 6 years ago

Linux 3.2.0-4-amd64 #1 SMP Debian 3.2.86-1 x86_64 GNU/Linux

My understanding of the issue is that "PyQt5.QtWebEngineWidgets" is not available in the Anaconda distribution. Spyder then falls back to PyQt5.QtWebKitWidgets, which is also not available because it has been deprecated and removed from Qt 5.6.

Is this the intended behavior?

Traceback (most recent call last):
  File "anaconda2/bin/spyder", line 11, in <module>
    sys.exit(main())
  File "anaconda2/lib/python2.7/site-packages/spyder/app/start.py", line 159, in main
    from spyder.app import mainwindow
  File "anaconda2/lib/python2.7/site-packages/spyder/app/mainwindow.py", line 92, in <module>
    from qtpy import QtWebEngineWidgets  # analysis:ignore
  File "anaconda2/lib/python2.7/site-packages/qtpy/QtWebEngineWidgets.py", line 26, in <module>
    from PyQt5.QtWebKitWidgets import QWebPage as QWebEnginePage
ImportError: No module named QtWebKitWidgets
mingwandroid commented 6 years ago

My understanding of the issue is that "PyQt5.QtWebEngineWidgets" is not available in the Anaconda distribution. Spyder then falls back to PyQt5.QtWebKitWidgets, which is also not available because it has been deprecated and removed from Qt 5.6.

No, that issue is out of date. Since Qt 5.9, PyQt5.QtWebEngineWidgets is available on all OSes (but only with Python 3 on Windows, Python 2 on Windows is restricted to needing Qt 5.6). Something else is going on here.

Can you show the output of LD_DEBUG=all spyder please? It will be pretty long I am afraid.

RinaldoB commented 6 years ago

Maybe this is in fact more useful

----> 1 import PyQt5.QtWebEngineWidgets
ImportError: libEGL.so.1: cannot open shared object file: No such file or directory
mingwandroid commented 6 years ago

Did spyder ever work on this machine? Are you really using Debian 7 / wheezy here?

Can you try installing libegl1-mesa and/or libgl1-mesa-glx and see if matters improve?

RinaldoB commented 6 years ago

spyder has been working for years on this machine, until the last ´conda update --all´, as stated in the opening post

yes, the machine is in Debian 7

mingwandroid commented 6 years ago

Ok did you try installing those packages?

RinaldoB commented 6 years ago

great, PyQt5.QtWebEngineWidgets can be imported after instalation of the libegl1-mesa packages. however spyder still fails to start with a Segmentation fault during the start up screen

mingwandroid commented 6 years ago

Thanks for the feedback. I setup a new Debian 7 VM and was able to run spyder with no problem.

Can you install gdb (using apt-get, unfortunately we do not currently have conda packages for this) and then run gdb --args python -c "from spyder.app.start import main; main()", then enter r, then, once it crashes enter bt and paste the output here. Cheers!

RinaldoB commented 6 years ago

Did you conda update --all in the Debian 7 VM?

I tried a fresh Anaconda 5.1 installation, and spyder is starting fine. After conda update --all i still get a segmentation fault:

Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x00007fffd3215f23 in QOpenGLContext::makeCurrent(QSurface*) ()
   from /Anaconda/lib/python2.7/site-packages/PyQt5/../../../libQt5Gui.so.5
#2  0x00007ffff7e09656 in ?? () from /Anaconda/lib/python2.7/site-packages/PyQt5/../../../libQt5QuickWidgets.so.5
#3  0x00007ffff7e0b50a in QQuickWidget::resizeEvent(QResizeEvent*) ()
   from /Anaconda/lib/python2.7/site-packages/PyQt5/../../../libQt5QuickWidgets.so.5
#4  0x00007fffc1763813 in ?? () from /Anaconda/lib/python2.7/site-packages/PyQt5/../../../libQt5WebEngineWidgets.so.5
#5  0x00007fffcdfb42c6 in QWidget::event(QEvent*) ()
   from /Anaconda/lib/python2.7/site-packages/PyQt5/../../../libQt5Widgets.so.5
#6  0x00007ffff7e0bf47 in QQuickWidget::event(QEvent*) ()
   from /Anaconda/lib/python2.7/site-packages/PyQt5/../../../libQt5QuickWidgets.so.5
#7  0x00007fffc1763b0e in ?? () from /Anaconda/lib/python2.7/site-packages/PyQt5/../../../libQt5WebEngineWidgets.so.5
#8  0x00007fffcdf897e0 in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
   from /Anaconda/lib/python2.7/site-packages/PyQt5/../../../libQt5Widgets.so.5
#9  0x00007fffcdf8f6a5 in QApplication::notify(QObject*, QEvent*) ()
   from /Anaconda/lib/python2.7/site-packages/PyQt5/../../../libQt5Widgets.so.5
#10 0x00007fffce4b594e in sipQApplication::notify(QObject*, QEvent*) ()
   from /Anaconda/lib/python2.7/site-packages/PyQt5/QtWidgets.so
#11 0x00007fffd6d8f85c in QCoreApplication::notifyInternal2(QObject*, QEvent*) ()
   from /Anaconda/lib/python2.7/site-packages/PyQt5/../../../libQt5Core.so.5
#12 0x00007fffcdfaeeae in QWidgetPrivate::sendPendingMoveAndResizeEvents(bool, bool) ()
   from /Anaconda/lib/python2.7/site-packages/PyQt5/../../../libQt5Widgets.so.5
#13 0x00007fffcdfb1ae2 in QWidgetPrivate::show_helper() ()
   from /Anaconda/lib/python2.7/site-packages/PyQt5/../../../libQt5Widgets.so.5
#14 0x00007fffcdfb1a95 in QWidgetPrivate::showChildren(bool) ()
   from /Anaconda/lib/python2.7/site-packages/PyQt5/../../../libQt5Widgets.so.5
#15 0x00007fffcdfb1afe in QWidgetPrivate::show_helper() ()
   from /Anaconda/lib/python2.7/site-packages/PyQt5/../../../libQt5Widgets.so.5
#16 0x00007fffcdfb1a95 in QWidgetPrivate::showChildren(bool) ()
   from /Anaconda/lib/python2.7/site-packages/PyQt5/../../../libQt5Widgets.so.5
#17 0x00007fffcdfb1afe in QWidgetPrivate::show_helper() ()
   from /Anaconda/lib/python2.7/site-packages/PyQt5/../../../libQt5Widgets.so.5
#18 0x00007fffcdfb1a95 in QWidgetPrivate::showChildren(bool) ()
   from /Anaconda/lib/python2.7/site-packages/PyQt5/../../../libQt5Widgets.so.5
#19 0x00007fffcdfb1afe in QWidgetPrivate::show_helper() ()
   from /Anaconda/lib/python2.7/site-packages/PyQt5/../../../libQt5Widgets.so.5
#20 0x00007fffcdfb3bb5 in QWidget::setVisible(bool) ()
   from /Anaconda/lib/python2.7/site-packages/PyQt5/../../../libQt5Widgets.so.5
#21 0x00007fffcdfb1a9f in QWidgetPrivate::showChildren(bool) ()
   from /Anaconda/lib/python2.7/site-packages/PyQt5/../../../libQt5Widgets.so.5
#22 0x00007fffcdfb1afe in QWidgetPrivate::show_helper() ()
   from /Anaconda/lib/python2.7/site-packages/PyQt5/../../../libQt5Widgets.so.5
#23 0x00007fffcdfb3bb5 in QWidget::setVisible(bool) ()
   from /Anaconda/lib/python2.7/site-packages/PyQt5/../../../libQt5Widgets.so.5
#24 0x00007fffce6461d3 in sipQTabWidget::setVisible(bool) () from /Anaconda/lib/python2.7/site-packages/PyQt5/QtWidgets.so
#25 0x00007fffcdfb1a9f in QWidgetPrivate::showChildren(bool) ()
   from /Anaconda/lib/python2.7/site-packages/PyQt5/../../../libQt5Widgets.so.5
#26 0x00007fffcdfb1afe in QWidgetPrivate::show_helper() ()
   from /Anaconda/lib/python2.7/site-packages/PyQt5/../../../libQt5Widgets.so.5
#27 0x00007fffcdfb1a95 in QWidgetPrivate::showChildren(bool) ()
   from /Anaconda/lib/python2.7/site-packages/PyQt5/../../../libQt5Widgets.so.5
#28 0x00007fffcdfb1afe in QWidgetPrivate::show_helper() ()
   from /Anaconda/lib/python2.7/site-packages/PyQt5/../../../libQt5Widgets.so.5
#29 0x00007fffcdfb1a95 in QWidgetPrivate::showChildren(bool) ()
   from /Anaconda/lib/python2.7/site-packages/PyQt5/../../../libQt5Widgets.so.5
#30 0x00007fffcdfb1afe in QWidgetPrivate::show_helper() ()
   from /Anaconda/lib/python2.7/site-packages/PyQt5/../../../libQt5Widgets.so.5
#31 0x00007fffcdfb3bb5 in QWidget::setVisible(bool) ()
   from /Anaconda/lib/python2.7/site-packages/PyQt5/../../../libQt5Widgets.so.5
#32 0x00007fffce5bd9f3 in sipQMainWindow::setVisible(bool) () from /Anaconda/lib/python2.7/site-packages/PyQt5/QtWidgets.so
#33 0x00007fffce693e62 in meth_QWidget_show () from /Anaconda/lib/python2.7/site-packages/PyQt5/QtWidgets.so
#34 0x00007ffff7ae2645 in PyEval_EvalFrameEx () from /Anaconda/bin/../lib/libpython2.7.so.1.0
#35 0x00007ffff7ae4519 in PyEval_EvalCodeEx () from /Anaconda/bin/../lib/libpython2.7.so.1.0
#36 0x00007ffff7ae14b2 in PyEval_EvalFrameEx () from /Anaconda/bin/../lib/libpython2.7.so.1.0
#37 0x00007ffff7ae4519 in PyEval_EvalCodeEx () from /Anaconda/bin/../lib/libpython2.7.so.1.0
#38 0x00007ffff7ae14b2 in PyEval_EvalFrameEx () from /Anaconda/bin/../lib/libpython2.7.so.1.0
#39 0x00007ffff7ae2ddc in PyEval_EvalFrameEx () from /Anaconda/bin/../lib/libpython2.7.so.1.0
#40 0x00007ffff7ae4519 in PyEval_EvalCodeEx () from /Anaconda/bin/../lib/libpython2.7.so.1.0
#41 0x00007ffff7ae473a in PyEval_EvalCode () from /Anaconda/bin/../lib/libpython2.7.so.1.0
#42 0x00007ffff7afd96d in run_mod () from /Anaconda/bin/../lib/libpython2.7.so.1.0
#43 0x00007ffff7afe786 in PyRun_StringFlags () from /Anaconda/bin/../lib/libpython2.7.so.1.0
#44 0x00007ffff7b0008e in PyRun_SimpleStringFlags () from /Anaconda/bin/../lib/libpython2.7.so.1.0
#45 0x00007ffff7b11b72 in Py_Main () from /Anaconda/bin/../lib/libpython2.7.so.1.0
#46 0x00007ffff6decead in __libc_start_main (main=<optimized out>, argc=<optimized out>, ubp_av=<optimized out>, init=<optimized out>, 
    fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe888) at libc-start.c:244
#47 0x00005555555548bf in _start ()
mingwandroid commented 6 years ago

I did update all, but I used Python 3 when I was testing this, I will get back to you after testing on Python 2.

RinaldoB commented 6 years ago

I rolled back to Anaconda 5.1 - spyder is working fine. Updated spyder to 3.2.8, still working fine. After qt update qt=5.9.5 pyqt=5.9.2 qtpy=1.3.1 things go wrong. spyder starts but the application window is solid black.

QOpenGLShaderProgram::uniformLocation(qt_Matrix): shader program is not linked
QOpenGLShaderProgram: could not create shader program
QOpenGLShader: could not create shader
QOpenGLShader: could not create shader
shader compilation failed: 

I think that qt 5.9 / PyQt5.QtWebEngineWidgets is not working properly on this machine.

mingwandroid commented 6 years ago

It sounds to me like your graphics drivers are not capable enough to run QtWebEngine, perhaps because your graphics hardware is too old?

Can you get details of both of those please?

mingwandroid commented 6 years ago

There are a lot of useful comments here: https://github.com/spyder-ide/spyder/issues/3226

Please let me know if any of them work for you.

RinaldoB commented 6 years ago

Graphic card: nvidia Quadro NVS 295 NVIDIA Driver Version: 304.131

mingwandroid commented 6 years ago

If you can run LD_DEBUG=all spyder and paste the results that would be helpful too.

mingwandroid commented 6 years ago

Also please try running (paraphrased from from, which has more details):

ldconf -p | grep libGL.so
cd /etc/ld.so.conf.d
cp x86-linux-gnu_GL.conf i386-linux-gnu_GL.conf
sudo ldconfig

https://github.com/Ultimaker/Cura/pull/131#issuecomment-176088664

RinaldoB commented 6 years ago

thanks! https://github.com/spyder-ide/spyder/issues/3226#issuecomment-316021155 fixed the issue for me. I would like to unterstand how the issue is related to installing libegl1-mesa, libgl1-mesa-glx. My understanding is that the fix prevents linking the mesa drivers to the GL library. Are the mesa drivers necessary on my machine?

Do you still need the output of LD_DEBUG=all spyder? I don't have root access on this machine. If you would like to do some further testing requiring root, please put it in one comment, and I will forward it to the admin.

mingwandroid commented 6 years ago

Great. Thanks a lot.

Can I safely remove the mesa drivers (libegl1-mesa, libgl1-mesa-glx) now?

Yes, probably, but can you confirm that the problem exhibits in the exact same with them installed and with them removed? Because if you were willing I'd like for you to do some quick tests on your machine.

First of all, would it be possible to try installing and running (in a separate test env so you do not risk any breakage to your base env) qtcreator and rstudio from my rdonnelly channel I'd appreciate it. This should hopefully be fairly quick and easy for you (modulus download time).

Also, depending on how those tests proceed (i.e. if they both run OK; they probably will not), if I made you some test executables would you be willing to try them out? (If you'd rather not then that's completely fine too, you've already been very helpful).

These tests will help me to identify where I need to make this fix. I would like to do it at as low level as I can in our Qt stack as then it will work for more things.

Pinging @ccordoba12 about perhaps replacing:

    from OpenGL import GL

with:

    import ctypes
    ctypes.CDLL("libGL.so.1", mode=ctypes.RTLD_GLOBAL)

though I've seen other versions of this workaround that check for it being run on ubuntu or debian first.

Do you still need the output of LD_DEBUG=all spyder

You shouldn't need root access for this AFAIK? But no, I do not need to see this.

ccordoba12 commented 6 years ago

Pinging @ccordoba12 about perhaps replacing: from OpenGL import GL

with:

import ctypes ctypes.CDLL("libGL.so.1", mode=ctypes.RTLD_GLOBAL)

Yes, we'll do it in our next version. Thanks for pointing it out Ray!

ccordoba12 commented 6 years ago

However, this is a problem for all PyQt apps that use WebEngine on Linux, not just for Spyder.

mingwandroid commented 6 years ago

No it's a very isolated problem for people using Debian or Ubuntu with broken Nvidia drivers who have also install Mesa drivers AFAICT.

I tested it on many many Linux distros here! Ok all without Nvidia hardware.

But I am asking @RinaldoB to help to figure out how low level I need to make this fix. You say "all PyQt apps that use WebEngine" but actually it's more likely "all Qt apps that use QtWebEngine, QtOpenGL, QtDeclarative (and maybe even QtWidgets)".

I will fix it at as a low-level as I have to.

ccordoba12 commented 6 years ago

it's more likely "all Qt apps that use QtWebEngine, QtOpenGL, QtDeclarative (and maybe even QtWidgets)".

I will fix it at as a low-level as I have to.

I thought it was a problem with WebEngine only, but thanks for trying to fix this in Anaconda itself.

jitseniesen commented 6 years ago

@mingwandroid I think I may have hit the same issue. I am on Debian testing, however I don't have an nvidia card. The video card is listed by lspci as Intel Corporation HD Graphics 620 (rev 02).

This is how I can trigger the issue:

  1. Install Anaconda 5.1 (64-bits, Python 3.6). Spyder works.
  2. Upgrade qt with conda install qt=5.9 pyqt=5.9 matplotlib=2. This installs qt 5.9.5. Spyder segfaults.
  3. Upgrade spyder with conda upgrade spyder. Spyder still segfaults.
  4. The gdb backtrace looks the same as https://github.com/ContinuumIO/anaconda-issues/issues/9199#issuecomment-382777146 (I checked only the first 10 frames).
  5. Edit .../spyder/app/start.py and replace from OpenGL import GL as suggested above. Spyder now works.
  6. Per your suggestion, I ran conda create -n test qtcreator rstudio -c rdonnelly. This installs qt 5.9.4 in the test environment. Rstudio and Qt Creator both start without any obvious problems.

Let me know if there is anything else I can do to help. I am afraid this is too low level for me to debug myself.

mingwandroid commented 6 years ago

Thanks @jitseniesen, that's very helpful. This changes the mystery in a subtle but important way. I'm glad I didn't go messing about deep inside Qt's C++ code to fix this which is what I was contemplating.

Let me know if there is anything else I can do to help

I have a quick query. You said:

Per your suggestion, I ran conda create -n test qtcreator rstudio -c rdonnelly. This installs qt 5.9.4 in the test environment. Rstudio and Qt Creator both start without any obvious problems.

It should've installed qt 5.9.5 in the test env since I don't have 5.9.4 in https://anaconda.org/rdonnelly/qt/files

.. 5.9.4 would've been there last week sometime, but not recently. Can you confirm the version number for me?

Also, can you try the example from: http://zetcode.com/gui/pyqt5/firstprograms/ and also the one from https://gist.github.com/gioditalia/03c9fd5d793aeccbe065fea45d842431 and see if they work for you?

@RinaldoB, if you have time, can you also try conda create -n test qtcreator rstudio -c rdonnelly and verify that they work fine for you please?

jitseniesen commented 6 years ago

It should've installed qt 5.9.5 in the test env since I don't have 5.9.4 in https://anaconda.org/rdonnelly/qt/files

.. 5.9.4 would've been there last week sometime, but not recently. Can you confirm the version number for me?

Yes, you're right. I ran conda create -n test qtcreator rstudio -c rdonnelly again and looked closely at what it did. It installs qt 5.9.5-h7e424d6_0 from the default channel.

Also, can you try the example from: http://zetcode.com/gui/pyqt5/firstprograms/ [...]

They all work fine

and also the one from https://gist.github.com/gioditalia/03c9fd5d793aeccbe065fea45d842431 and see if they work for you?

That one does not work:

~$ python qwe.py 
[5169:5169:0100/000000.065026:ERROR:broker_posix.cc(41)] Invalid node channel message
Segmentation fault

Same backtrace:

#0  0x0000000000000000 in ?? ()
#1  0x00007ffff24f1f23 in QOpenGLContext::makeCurrent(QSurface*) ()
   from /home/jitse/misc/anaconda/lib/python3.6/site-packages/PyQt5/../../../libQt5Gui.so.5
#2  0x00007ffff23e3656 in ?? ()
   from /home/jitse/misc/anaconda/lib/python3.6/site-packages/PyQt5/../../.././libQt5QuickWidgets.so.5
#3  0x00007ffff23e550a in QQuickWidget::resizeEvent(QResizeEvent*) ()
   from /home/jitse/misc/anaconda/lib/python3.6/site-packages/PyQt5/../../.././libQt5QuickWidgets.so.5

However, if I edit the file and put

import ctypes
ctypes.CDLL("libGL.so.1", mode=ctypes.RTLD_GLOBAL)

before from PyQt5 import QtWebEngineWidgets, then it does work.

RinaldoB commented 6 years ago

can you also try conda create -n test qtcreator rstudio -c rdonnelly and verify that they work fine for you please?

On a fresh miniconda installation and qt=5.9.5, qtcreator and rstudio are starting up fine on my machine.

and also the one from https://gist.github.com/gioditalia/03c9fd5d793aeccbe065fea45d842431 and see if they work for you?

This example did not work:

QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-rinaldo'
QOpenGLShaderProgram: could not create shader program
QOpenGLShader: could not create shader
Could not link shader program:
 ""
QOpenGLShaderProgram: could not create shader program
QOpenGLShader: could not create shader
QOpenGLShader: could not create shader
shader compilation failed: 
""
QOpenGLShaderProgram::uniformLocation(matrix): shader program is not linked
QOpenGLShaderProgram::uniformLocation(opacity): shader program is not linked

However, if I edit the file and put

import ctypes ctypes.CDLL("libGL.so.1", mode=ctypes.RTLD_GLOBAL) before from PyQt5 import QtWebEngineWidgets, then it does work.

on my machine this also helped. the script showed a white, blank window. not sure if it is supposed to display more than that.

How the mesa drivers are related to this problem still puzzles me. Before installing libegl1-mesa and libgl1-mesa-glx I could not import PyQt5.QtWebEngineWidgets:

----> 1 import PyQt5.QtWebEngineWidgets
ImportError: libEGL.so.1: cannot open shared object file: No such file or directory

But it seems now that the solution for the issue is to actually prevent to mesa driver from loading by importing libGL.so.1 ?! I won't dig into it, as Im fine with the fix so far, but I am curious whether PyQt5.QtWebEngineWidgets would work without mesa drivers on this machine (can't remove the drivers due to missing root)

Kevin1129 commented 6 years ago

The solution is quite simple, reinstall Qt in conda:

conda install -c anaconda qt

ccordoba12 commented 6 years ago

@Kevin1129, the right command is

conda install -f qt
Russell-Jones-OxPhys commented 5 years ago

python3 -m pip install --upgrade PyQtWebEngine ? Any reason this isn't a dependency of spyder?