1. 程式人生 > >Spyder (Ubuntu 18.04) Segmentation Fault錯誤解決方案

Spyder (Ubuntu 18.04) Segmentation Fault錯誤解決方案

1、Ubuntu環境下,安裝了tensorflow,執行Spyder,出現Segmentation Fault錯誤

2、原因查詢:

    1)pyqt、qt都已經安裝;

    2)pip install - U spyder,重新安裝,仍然報錯;

3、環境描述

    [email protected]:~/anaconda3/bin$ inxi -G
           Graphics:  Card: Intel 3rd Gen Core processor Graphics Controller
           Display Server: x11 (X.Org 1.19.6 ) driver: i915
           Resolution: [email protected]
           OpenGL: renderer: Mesa DRI Intel Ivybridge Mobile

           version: 4.2 Mesa 18.0.0-rc5

(base) [email protected]:~/anaconda3/bin$ gdb ./python
    GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git
    Copyright (C) 2018 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "x86_64-linux-gnu".
    Type "show configuration" for configuration details.
    For bug reporting instructions, please see:
    <http://www.gnu.org/software/gdb/bugs/>.
    Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.
    For help, type "help".
    Type "apropos word" to search for commands related to "word"...
    Reading symbols from ./python...done.
    (gdb) run
    Starting program: /home/liuxs/anaconda3/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.4 |Anaconda, Inc.| (default, Jan 16 2018, 18:10:19) 
    [GCC 7.2.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from spyder.app.start import main
    >>> main()
    [New Thread 0x7fffce203700 (LWP 8433)]
    [New Thread 0x7fffcd7e6700 (LWP 8434)]
    [New Thread 0x7fffbde65700 (LWP 8439)]
    [New Thread 0x7fffbd664700 (LWP 8444)]
    [New Thread 0x7fffbce63700 (LWP 8445)]
    [New Thread 0x7fffaffff700 (LWP 8446)]
    [New Thread 0x7fffaf7fe700 (LWP 8447)]
    [New Thread 0x7fffaeffd700 (LWP 8448)]
    [New Thread 0x7fffae7fc700 (LWP 8449)]
    [New Thread 0x7fffadffb700 (LWP 8450)]
    [New Thread 0x7fffad7fa700 (LWP 8451)]
    [New Thread 0x7fffacff9700 (LWP 8452)]
    [New Thread 0x7fff8ffff700 (LWP 8453)]
    [New Thread 0x7fff8f7fe700 (LWP 8454)]
    [New Thread 0x7fff8e7fc700 (LWP 8456)]
    [New Thread 0x7fff8effd700 (LWP 8455)]
    [New Thread 0x7fff8dffb700 (LWP 8457)]
    [New Thread 0x7fff8d7fa700 (LWP 8458)]
    [New Thread 0x7fff8cff9700 (LWP 8459)]
    [New Thread 0x7fff73fff700 (LWP 8460)]
    [New Thread 0x7fff737fe700 (LWP 8461)]
    [New Thread 0x7fff72ffd700 (LWP 8464)]
    [New Thread 0x7fff727fc700 (LWP 8465)]
    [New Thread 0x7fff71ffb700 (LWP 8467)]
    [New Thread 0x7fff717fa700 (LWP 8468)]
    [New Thread 0x7fff70ff9700 (LWP 8470)]
    [New Thread 0x7fff5ffff700 (LWP 8471)]
    [New Thread 0x7fff5f7fe700 (LWP 8473)]
    [New Thread 0x7fff5de1b700 (LWP 8474)]
    [New Thread 0x7fff5d61a700 (LWP 8475)]
    [Thread 0x7fff5d61a700 (LWP 8475) exited]
    [Thread 0x7fff5de1b700 (LWP 8474) exited]
    [New Thread 0x7fff5de1b700 (LWP 8483)]
    [Thread 0x7fff5de1b700 (LWP 8483) exited]
    [New Thread 0x7fff5de1b700 (LWP 8485)]
    [New Thread 0x7fff5d61a700 (LWP 8490)]
    Thread 1 "python3.6" received signal SIGSEGV, Segmentation fault.
    0x0000000000000000 in ?? ()
    (gdb) exit()
    Undefined command: "exit".  Try "help".
    (gdb) 
    Undefined command: "exit".  Try "help".
    (gdb) 
    Undefined command: "exit".  Try "help".
    (gdb) Quit

4、解決方案(上面一堆廢話都不需要看了)

  1. # pip3 install pyopengl
  • 重點檢查pyopengl有沒有安裝,如果沒有安裝,鐵定就是他的原因了
   2. Add from OpenGL import GL to site-packages/spyder/app/start.py(可能已經存在)
  • # This import is needed to fix errors with OpenGL when installed using pip
    # See issue 3332
    try:
        from OpenGL import GL
    except:
        pass
愉快的使用spyder吧……