title: Segmentation fault (core dumped) in python 2.7 when importing pyqtgraph
body: <p>So I've been working on a python project in which I wanted to use pyqtgraph to plot data from a sensor in real-time.</p>
  
  <p>However, when first trying to run the code, I got a <code>Segmentation fault (core dumped)</code>.</p>
  
  <p>I could isolate the one line of code responsible for the crash which was  <code>import pyqtgraph as pg</code>.</p>
  
  <p>Running gdb yielded: </p>
  
  <pre><code>gdb python
  
  [...]
  Reading symbols from python...(no debugging symbols found)...done.
  (gdb) run
  Starting program: /usr/bin/python 
  [Thread debugging using libthread_db enabled]
  Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
  Python 2.7.6 (default, Oct 26 2016, 20:30:19) 
  [GCC 4.8.4] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  &gt;&gt;&gt; import pyqtgraph
  
  Program received signal SIGSEGV, Segmentation fault.
  strlen () at ../sysdeps/x86_64/strlen.S:106
  106 ../sysdeps/x86_64/strlen.S: No such file or directory.
  (gdb) backtrace
  #0  strlen () at ../sysdeps/x86_64/strlen.S:106
  #1  0x00000000004ee6f6 in PyString_FromFormatV ()
  #2  0x0000000000506e80 in PyErr_Format ()
  #3  0x00007ffff0e69acb in ?? () from /usr/lib/python2.7/dist-packages/sip.so
  #4  0x00007ffff58143a3 in initQtGui () from /usr/lib/python2.7/dist-packages/PyQt4/QtGui.so
  #5  0x0000000000427992 in _PyImport_LoadDynamicModule ()
  #6  0x000000000055642f in ?? ()
  #7  0x00000000004e2dec in ?? ()
  #8  0x0000000000556cf1 in ?? ()
  #9  0x0000000000569cd8 in ?? ()
  #10 0x00000000004c8c8b in PyEval_CallObjectWithKeywords ()
  #11 0x00000000005264a8 in PyEval_EvalFrameEx ()
  #12 0x0000000000555551 in PyEval_EvalCodeEx ()
  #13 0x00000000005b41e2 in PyEval_EvalCode ()
  #14 0x00000000005b429a in PyImport_ExecCodeModuleEx ()
  #15 0x00000000005942af in ?? ()
  #16 0x000000000055642f in ?? ()
  #17 0x0000000000556838 in ?? ()
  #18 0x0000000000556d9b in ?? ()
  #19 0x0000000000569cd8 in ?? ()
  #20 0x00000000004c8c8b in PyEval_CallObjectWithKeywords ()
  #21 0x00000000005264a8 in PyEval_EvalFrameEx ()
  #22 0x0000000000555551 in PyEval_EvalCodeEx ()
  #23 0x00000000005b41e2 in PyEval_EvalCode ()
  #24 0x00000000005b429a in PyImport_ExecCodeModuleEx ()
  #25 0x00000000005942af in ?? ()
  #26 0x0000000000465804 in ?? ()
  #27 0x000000000055642f in ?? ()
  #28 0x0000000000556838 in ?? ()
  #29 0x0000000000556c4b in ?? ()
  #30 0x0000000000569c08 in ?? ()
  #31 0x00000000004c8c8b in PyEval_CallObjectWithKeywords ()
  #32 0x00000000005264a8 in PyEval_EvalFrameEx ()
  #33 0x0000000000567d14 in ?? ()
  #34 0x0000000000465a2d in PyRun_InteractiveOneFlags ()
  #35 0x0000000000465b49 in PyRun_InteractiveLoopFlags ()
  #36 0x00000000004661fe in PyRun_AnyFileExFlags ()
  #37 0x0000000000466d92 in Py_Main ()
  #38 0x00007ffff7814f45 in __libc_start_main (main=0x466e50 &lt;main&gt;, argc=1, argv=0x7fffffffd8c8, init=&lt;optimized out&gt;, fini=&lt;optimized out&gt;, rtld_fini=&lt;optimized out&gt;, stack_end=0x7fffffffd8b8)
      at libc-start.c:287
  #39 0x0000000000577c2e in _start ()
  (gdb) 
  #0  strlen () at ../sysdeps/x86_64/strlen.S:106
  #1  0x00000000004ee6f6 in PyString_FromFormatV ()
  #2  0x0000000000506e80 in PyErr_Format ()
  #3  0x00007ffff0e69acb in ?? () from /usr/lib/python2.7/dist-packages/sip.so
  #4  0x00007ffff58143a3 in initQtGui () from /usr/lib/python2.7/dist-packages/PyQt4/QtGui.so
  #5  0x0000000000427992 in _PyImport_LoadDynamicModule ()
  #6  0x000000000055642f in ?? ()
  #7  0x00000000004e2dec in ?? ()
  #8  0x0000000000556cf1 in ?? ()
  #9  0x0000000000569cd8 in ?? ()
  #10 0x00000000004c8c8b in PyEval_CallObjectWithKeywords ()
  #11 0x00000000005264a8 in PyEval_EvalFrameEx ()
  #12 0x0000000000555551 in PyEval_EvalCodeEx ()
  #13 0x00000000005b41e2 in PyEval_EvalCode ()
  #14 0x00000000005b429a in PyImport_ExecCodeModuleEx ()
  #15 0x00000000005942af in ?? ()
  #16 0x000000000055642f in ?? ()
  #17 0x0000000000556838 in ?? ()
  #18 0x0000000000556d9b in ?? ()
  #19 0x0000000000569cd8 in ?? ()
  #20 0x00000000004c8c8b in PyEval_CallObjectWithKeywords ()
  #21 0x00000000005264a8 in PyEval_EvalFrameEx ()
  #22 0x0000000000555551 in PyEval_EvalCodeEx ()
  #23 0x00000000005b41e2 in PyEval_EvalCode ()
  #24 0x00000000005b429a in PyImport_ExecCodeModuleEx ()
  #25 0x00000000005942af in ?? ()
  #26 0x0000000000465804 in ?? ()
  #27 0x000000000055642f in ?? ()
  #28 0x0000000000556838 in ?? ()
  #29 0x0000000000556c4b in ?? ()
  #30 0x0000000000569c08 in ?? ()
  #31 0x00000000004c8c8b in PyEval_CallObjectWithKeywords ()
  #32 0x00000000005264a8 in PyEval_EvalFrameEx ()
  #33 0x0000000000567d14 in ?? ()
  #34 0x0000000000465a2d in PyRun_InteractiveOneFlags ()
  #35 0x0000000000465b49 in PyRun_InteractiveLoopFlags ()
  #36 0x00000000004661fe in PyRun_AnyFileExFlags ()
  #37 0x0000000000466d92 in Py_Main ()
  #38 0x00007ffff7814f45 in __libc_start_main (main=0x466e50 &lt;main&gt;, argc=1, argv=0x7fffffffd8c8, init=&lt;optimized out&gt;, fini=&lt;optimized out&gt;, rtld_fini=&lt;optimized out&gt;, stack_end=0x7fffffffd8b8)
      at libc-start.c:287
  #39 0x0000000000577c2e in _start ()
  (gdb) 
  #0  strlen () at ../sysdeps/x86_64/strlen.S:106
  #1  0x00000000004ee6f6 in PyString_FromFormatV ()
  #2  0x0000000000506e80 in PyErr_Format ()
  #3  0x00007ffff0e69acb in ?? () from /usr/lib/python2.7/dist-packages/sip.so
  #4  0x00007ffff58143a3 in initQtGui () from /usr/lib/python2.7/dist-packages/PyQt4/QtGui.so
  #5  0x0000000000427992 in _PyImport_LoadDynamicModule ()
  #6  0x000000000055642f in ?? ()
  #7  0x00000000004e2dec in ?? ()
  #8  0x0000000000556cf1 in ?? ()
  #9  0x0000000000569cd8 in ?? ()
  #10 0x00000000004c8c8b in PyEval_CallObjectWithKeywords ()
  #11 0x00000000005264a8 in PyEval_EvalFrameEx ()
  #12 0x0000000000555551 in PyEval_EvalCodeEx ()
  #13 0x00000000005b41e2 in PyEval_EvalCode ()
  #14 0x00000000005b429a in PyImport_ExecCodeModuleEx ()
  #15 0x00000000005942af in ?? ()
  #16 0x000000000055642f in ?? ()
  #17 0x0000000000556838 
  </code></pre>
  
  <p>Running the same in Python3 worked totally fine, but using Python3 is not an option for me, since this would conflict with a large part of the frame of my project.</p>
  
  <p>I also tried reinstalling pyqtgraph via pip several times.</p>
  
  <pre><code>$ pip show pyqtgraph
  Name: pyqtgraph
  Version: 0.10.0
  Summary: Scientific Graphics and GUI Library for Python
  Home-page: http://www.pyqtgraph.org
  Author: Luke Campagnola
  Author-email: luke.campagnola@gmail.com
  License: MIT
  Location: /usr/local/lib/python3.4/dist-packages
  Requires: numpy
  </code></pre>
  
  <p>I have been searching and trying for hours now and haven't found any solution, so I would appreciate any help.</p>
  
  <p>Cheers</p>
  
  <p>A despaired programmer.</p>