Spyder: Spyder crashes with segmentation fault on startup in Anaconda 4.5.0

Created on 16 Apr 2018  路  38Comments  路  Source: spyder-ide/spyder

DEVELOPER NOTE: This error is now fixed in Spyder >= 3.3.0. To resolve it, please update to the current version with conda update spyder from the Anaconda Prompt/Terminal/command line, which also fixes other bugs and adds new features, enhancement and usability/documentation improvements. Thanks!

Hi,
after updating Spyder on Anaconda it crashes on startup. The splash screen shows up before terminating with a segmentation fault. It can be reproduced in a minimal Anaconda environment with:

# Create minimal environment:
~$ conda --version
conda 4.5.0
~$ conda create --name tst
~$ conda activate tst
~$ conda install spyder
~$ rm -rf ~/.config/spyder-py3
~$ SPYDER_DEBUG="3" spyder --reset
*** Reset Spyder settings to defaults ***
removing: /home/brunn/.config/spyder-py3/spyder.ini
removing: /home/brunn/.config/spyder-py3/langconfig

# Run spyder:
~$ SPYDER_DEBUG="3" spyder
Start of MainWindow constructor
End of MainWindow constructor
*** Start of MainWindow setup ***
  ..core actions
  ..toolbars
  ..tools
  ..sift?
  ..plugin: internal console
    ..internal console: initializing
  ..plugin: working directory
Loading help...
Loading outline explorer...
Loading editor...
Introspection Plugin Loaded: rope
Introspection Plugin Loaded: jedi
Introspection Plugin Loaded: fallback
setfocusto: <spyder.widgets.sourcecode.codeeditor.CodeEditor object at 0x7f99901c3948>
current_changed: 0 <spyder.widgets.sourcecode.codeeditor.CodeEditor object at 0x7f99901c3948> 140297524492616
Added thread <spyder.widgets.editor.AnalysisThread object at 0x7f9990155ee8> to queue
Added thread <spyder.widgets.editor.AnalysisThread object at 0x7f9990155f78> to queue
  ..widgets
Loading file explorer...
Loading history plugin...
Loading online help...
Loading project explorer...
Updating queue:
    started: 0
    pending: 2
===>starting: <spyder.widgets.editor.AnalysisThread object at 0x7f9990155ee8>
Updating queue:
    started: 1
    pending: 1
===>starting: <spyder.widgets.editor.AnalysisThread object at 0x7f9990155f78>
Loading namespace browser...
Updating queue:
    started: 0
    pending: 0
Updating queue:
    started: 0
    pending: 0
Loading IPython console...
Setting up main window...
Setting up window...
*** End of MainWindow setup ***
Speicherzugriffsfehler (means: segmentation fault)

I'm not quite sure how to continue debugging. Investigating the core dump did not yield in any results.
I'm using Debian unstable. The conda package info returns:

spyder 3.2.8 py36_0
-------------------
file name   : spyder-3.2.8-py36_0.tar.bz2
name        : spyder
version     : 3.2.8
build string: py36_0
build number: 0
channel     : https://repo.anaconda.com/pkgs/main/linux-64
size        : 2.6 MB
arch        : None
constrains  : ()
license     : MIT
md5         : 9ad003181d3ce2134a6f024b86a2cdab
platform    : None
subdir      : linux-64
timestamp   : 1521092348360
url         : https://repo.anaconda.com/pkgs/main/linux-64/spyder-3.2.8-py36_0.tar.bz2
dependencies:
    chardet >=2.0
    cloudpickle
    jedi >=0.9
    nbconvert
    numpydoc
    pickleshare
    psutil
    pycodestyle
    pyflakes
    pygments >=2.0
    pylint
    pyqt
    python >=3.6,<3.7.0a0
    pyzmq
    qtawesome >=0.4.1
    qtconsole >=4.2
    qtpy >=1.2.0
    rope >=0.9.4
    sphinx
PyQt Completed Bug

Most helpful comment

Following a suggestion in #3326, I was able to work around the problem by doing

conda install pyopengl

This problem is also addressed in PR #7029. Thanks.

All 38 comments

What are your Qt and PyQt versions?

I have the following versions installed:

pyqt                      5.9.2            py36h751905a_0
qt                        5.9.5                h7e424d6_0

The file conda_packages.txt contains the output of the commandconda list.

I had the same problem (after pyqt updates Spyder crashed on startup or when I tried to resize windows). Downgrading pyqt to 5.6.0 solved the issue for me.

@ccordoba12 After installing Spyder 3.2.8 into a fresh environment on my clean test Win 10 machine with Qt/PyQt 5.9, I also got a crash on launch, while it worked just fine in a 5.6 environment on the same machine.`If you want me to do more specific testing, I can do so.

This is really bad! I thought things were working fine for PyQt 5.9 on Windows.

@CAM-Gerlach, could you post the output of conda list in your environment? Thanks!

@ccordoba12 Actually, good news and bad news. When I created another new environment on my test machine with Spyder and Qt 5.9, everything worked just fine. It seems the one non-Spyder additional package I'd installed in that env, the pandas soft-dependency feather-format to power the pandas read_feather and to_feather functions, downgraded qt/pyqt to 5.6.2/5.6 which completely broke Spyder to the point it would crash almost instantly on launch to a "Python has stopped working" before even printing the first debug message. Ironically, upgrading back to 5.9.4/5.9.2 got Spyder working again. However, what I have not tried is upgrading an existing env with Spyder, etc. installed from Qt/PyQt 5.6 to 5.9...if you think that would help, I can.

Attached is a backtrace generated with:

$ gdb /home/brunn/anaconda3/envs/tst/bin/python
...
(gdb) run
Starting program: /home/brunn/anaconda3/envs/tst/bin/python
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". 
Python 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 18:21:58) 
...
>>> from spyder.app.start import main
>>> main()
...
Thread 1 "ZMQbg/5" received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt

Following a suggestion in #3326, I was able to work around the problem by doing

conda install pyopengl

This problem is also addressed in PR #7029. Thanks.

Same issue for me on Ubuntu 18.04. Doing a conda install pyopengl fixed it for me as well. Here is the output, which may shed some light.

conda install pyopengl
Solving environment: done

## Package Plan ##

  environment location: /home/jack/Anaconda3

  added / updated specs: 
    - pyopengl


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    pyopengl-3.1.1a1           |      np113py36_0         1.1 MB
    numpy-1.13.3               |   py36hdbf6ddf_4         3.9 MB
    freeglut-2.8.1             |                0         554 KB
    ------------------------------------------------------------
                                           Total:         5.6 MB

The following NEW packages will be INSTALLED:

    freeglut: 2.8.1-0              
    pyopengl: 3.1.1a1-np113py36_0  

The following packages will be DOWNGRADED:

    numpy:    1.14.2-py36hdbf6ddf_1 --> 1.13.3-py36hdbf6ddf_4

Thanks folks! I have the same issue and fixed it by installing opengl.

One reminder: Be sure to do this for all your environments.

Same issue for me, installing pyopengl solved the issue.

Just to add, same behavior and solution on my Fedora 28 VM.

By doing _conda install pyopengl_ solve my problem on ubuntu 18.04

Also, just FYI, Spyder 3.3 (out in a week or so) has a built-in workaround for the issue so you won't need to install OpenGL and should avoid these segfaults.

Have a low-end AMD/Radeon DELL laptop that has the same problem, Anaconda3-5.2.0 on Ubuntu 18.04.
Installing pyopengl via conda fixed it

Strange thing is I have an Intel/Nvidia DELL tower running Anaconda3-5.2.0 on Ubuntu 18.04 with no issue.


added / updated specs:
- pyopengl

The following packages will be downloaded:

package                    |            build
---------------------------|-----------------
pyopengl-3.1.1a1           |      np113py36_0         1.1 MB
numpy-1.13.3               |   py36hdbf6ddf_4         3.9 MB
freeglut-2.8.1             |                0         554 KB
------------------------------------------------------------
                                       Total:         5.6 MB

The following NEW packages will be INSTALLED:

freeglut: 2.8.1-0              
pyopengl: 3.1.1a1-np113py36_0

The following packages will be REMOVED:

anaconda: 5.2.0-py36_3

The following packages will be DOWNGRADED:

numpy:    1.14.3-py36hcd700cb_1 --> 1.13.3-py36hdbf6ddf_4

Could have been different drivers on the machine...I had the same issue, except on a laptop with an Intel (3630QM) and Intel (HD4000)/Nvidia (GTX 670M) setup, inside a Fedora VM running on VirtualBox.

Have a high-end NVIDIA HP OMEN 15-CE072TX laptop that has the same problem, Anaconda3-5.2.0 on Ubuntu 18.04.
Installing pyopengl via conda fixed it
fire command in terminal:- conda install pyopengl

The following packages will be downloaded:

package | build
---------------------------|-----------------
pyopengl-3.1.1a1 | np113py36_0 1.1 MB
numpy-1.13.3 | py36hdbf6ddf_4 3.9 MB

freeglut-2.8.1 | 0 554 KB

                                   Total:         5.6 MB

The following NEW packages will be INSTALLED:

freeglut: 2.8.1-0
pyopengl: 3.1.1a1-np113py36_0
The following packages will be REMOVED:

anaconda: 5.2.0-py36_3
The following packages will be DOWNGRADED:

numpy: 1.14.3-py36hcd700cb_1 --> 1.13.3-py36hdbf6ddf_4

I got the same error on a fresh installation of Anaconda 3.6 on Ubuntu 18.04.01. It was a clean install without any modifications done to it and using the newest versions of everything. Seems like this isn't resolved yet?

Can confirm conda install pyopengl solved the issue.

Seems like this isn't resolved yet?

Things are solved now in Spyder 3.3.0 without the need of pyopengl. Since that version is not included in the latest Anaconda, you have to update to it with conda update spyder.

Hi everyone!
I've been facing the same issue:

Traceback (most recent call last):
File "/home/usr/anaconda2/envs/py36/lib/python3.6/site-packages/qtpy/QtWebEngineWidgets.py", line 22, in
from PyQt5.QtWebEngineWidgets import QWebEnginePage
ImportError: libGLdispatch.so.0: 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/usr/anaconda2/envs/py36/bin/spyder", line 11, in
sys.exit(main())
File "/home/usr/anaconda2/envs/py36/lib/python3.6/site-packages/spyder/app/start.py", line 190, in main
from spyder.app import mainwindow
File "/home/usr/anaconda2/envs/py36/lib/python3.6/site-packages/spyder/app/mainwindow.py", line 92, in
from qtpy import QtWebEngineWidgets # analysis:ignore
File "/home/usr/anaconda2/envs/py36/lib/python3.6/site-packages/qtpy/QtWebEngineWidgets.py", line 26, in
from PyQt5.QtWebKitWidgets import QWebPage as QWebEnginePage
ModuleNotFoundError: No module named 'PyQt5.QtWebKitWidgets'

I'm working in linux Ubuntu 16.04. I've Nvidia grapphic card too.
I've been searching and trying many different suggestion like:

  • install pyopengl in my anaconda envs : py 3.5 and py3.6

  • checking the followed lines in /spyder/app/start.py
    import ctypes
    ctypes.CDLL("libGL.so.1", mode=ctypes.RTLD_GLOBAL)
    from OpenGL import GL

All was OK, but spyder didn't launch ....

  • Finally, I solved my problem downgrading pyqt to 5.6.0 in my anaconda env.

I hope it helps to someone else!

@debpol It may be related (both OpenGL) but this doesn't appear to be the exact same issue, since this one is about a segmentation fault (i.e. C==/Qt level problem) on startup while you are describing a Python-level exception, and the confirmed solution to the particular problem in this thread was either conda install pyopengl, or (now) upgrading to Spyder >=3.3.0.

Most likely, this sounds like an OS, Qt, or install-specific issue. What specific version of Spyder, Qt, PyQt, and Python were you running when they happened under PyQt 5.9? Try updating Spyder in place if it is <3.3.0, and creating a fresh environment for Spyder (conda create -n name-your-env python=3.6, then source activate name-your-env), and installing Spyder there (conda install spyder). Also, a potential source of problems is using Anaconda2 with Python 3 environments; it is generally a better idea to use Anaconda3 and then create a Py2 env if you need it (I've tested Spyder in Py2 environments on Anaconda3 a number of times, and never had a problem). Finally, please try the steps listed in the Spyder Troubleshooting Guide, specifically the Basic First Aid and Emergency CPR sections, which resolve most common install issues. Thanks!

Ubuntu 18.04, this issue can be resolved by either conda install pyopengl or update spyder version 3.3.1 by conda update spyder

@vollbier thank you very much. this worked for me.

I am using windows linux subsystem. ubuntu 18 from Microsoft store
Anaconda >> python 3.6.

All working fine

Just FYI, the best solution is to simply upgrade to Spyder 3.3.1, as the workaround to the third party pyopengl issue is built-in to 3.3.0 and above and there's no need to install pyopengl. You'll also get the latest Spyder features, bug fixes and enhancements, as well as our thoroughly updated and expanded documentation, tutorial, etc (the old ones will go away soon, since they are very out of date).

@CAM-Gerlach , thanks just upgraded, awesome

conda install pyopengl fixed the problem, thanks!

@AlcaArctica update spyder to latest version and the problem will be solved

Yeah, no need of pyopengl.

@ccordoba12 I put a disclaimer at the top of the thread, so hopefully that'll finally help stem the tide of people installing pyopengl (and presumably not updating to the latest version of Spyder).

..should have read it more carefully. Thanks!

@debpol
Using Spyder 3.3.1, python 2.7, and Anaconda 4.5.11, Linux Mint 19

The SegFault issues persists when installing Anaconda in a Python 2.7 environment. debpol's solution of downgrading PyQT to 5.6.0 is what resolved the issue for me.

Installing opengl did not fix the problem.... seems like a pyqt issue (or spyder not playing nice with pyqt) to me. I read the responses to @debpol's post. In my case, the error was definitely "Segmentation Fault" on spyder3 startup. Spyder3 failed to display even the splash screen before the error was shown. Here is the exact error (I must say, it wasn't all that helpful):

$spyder
Segmentation fault (core dumped)

^^That was it, the entire error message. I suppose I could try to figure out where the dump went, but PyQt 5.6.0 resolved my problem, so meh.

What worked for me:

Uninstalled: PyOpenGL
Installed: Spyder 3.3.1 & QT 5.9.6 & PyQT 5.9.2

With the 5.6 versions of qt and pyqt I had the 'segmentation fault (core dumped)' error.
I'm using python 2.7, anaconda 4.5.11, Ubuntu 16.04

I installed opencv in anaconda and because of that Pyqt is downgraded , for fixing the issue I updated pyqt and after that spyder have come back to stage:) thanks @albertigno

I have had this error with spyder 3.3.2. I had to update pyqt:
pyqt: 5.6.0-py36_2 --> 5.6.0-py36h8210e8a_8

Now spyder runs correctly.

I have had this error with spyder 3.3.2. I had to update pyqt:
pyqt: 5.6.0-py36_2 --> 5.6.0-py36h8210e8a_8

Now spyder runs correctly.

Thanks alot! This worked for me too!

You can all also try updating to PyQt 5.9, unless you have something else in your environment blocking it (conda install pyqt=5.9 qt=5.9).

As mentioned a few times in this thread, conda update pyqt solved the problem for me.

You can all also try updating to PyQt 5.9, unless you have something else in your environment blocking it (conda install pyqt=5.9 qt=5.9).

Thank you! This solved my problem.

Was this page helpful?
0 / 5 - 0 ratings