Hi Larry, I believe the bug you are seeing is in the PyQt4 packages for Python 3 in ubuntu. On one of my machines (Mint 18), I get a segmentation fault just by importing PyQt4.QtGui from Python 3:
$ python3 Python 3.5.2 (default, Nov 17 2016, 17:05:23) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import PyQt4.QtGui Segmentation fault On another machine (Ubuntu 17.10), I cannot reproduce the bug, so I hope this has already been fixed upstream. PyQt5 works on all systems I have tested. The reason importing PyQt5 fixes the issue with pyqtgraph is that it forces pyqtgraph to use PyQt5, rather than importing PyQt4 on its own. Luke On Wed, Feb 14, 2018 at 9:53 AM, Larry Byars <boome...@gmail.com> wrote: > Hello. I decided to do some exploration of pyqtgraph today on my Xubuntu > 16.04 system with python 3.5.2 and PyQt5. I tried several methods of > installing pyqtgraph but in all cases when I started python3 and typed > "import pyqtgraph" I got a Segmentation fault and reported here and > elsewhere. Being a stubborn sort (you get that way when you've been > programming for 50 years) I couldn't give up. As I was looking at some of > the examples I was a bit astonished to see code like: > > >>> from pyqtgraph.Qt import QtCore, QtGui > > rather than what I was used to in my learning about PyQT5. So I started > python3 again and typed: > >>> import PyQt5 > >>> import pyqtgraph > > and guess what? It didn't crash! I was able to run the examples and learn > a bit about the workings of pyqtgraph. One additional note, in trying to > execute the fractal.py example I got errors about mats = reduce(matmul, > mats) and discovered that reduce is no longer native for python 3 but needs > to be imported from functools. Small change to fractal.py and it works. > > Anyway, I hope this discovery will help others that are trying to explore > pyqtgraph but not getting past the first step. Probably someone with much > more experience than me (at least with python) will have to figure out why > this works. > > Suggestions to us Anaconda are not very appealing to me since I'm > developing some code that will be used by others and I don't want them to > have to install Anaconda. > > I haven't tried this on in a Windows environment (yet) where my > application is currently deployed. I'll have to see if pyqtgraph provides > me the right functionality to be able to integrate it with my other pyqt5 > code. > > But on first look, I'm impressed with the functionality of pyqtgraph. Good > work! > > On Wednesday, September 13, 2017 at 5:31:27 PM UTC-4, Armen Levonian wrote: >> >> So for some reason pyqtgraph started giving the segmentation fault >> immediately upon importing the module. >> The strange thing was that after I installed it today for Python 3.52 and >> after installing all the other deps, it was working perfectly, including >> running examples for PyQt5. >> >> The other strange thing is that it is working perfectly for Python 2.7 >> (with PyQt4). >> Google search led me to: >> *https://stackoverflow.com/questions/44821475/segmentation-fault-core-dumped-in-python-2-7-when-importing-pyqtgraph >> <https://stackoverflow.com/questions/44821475/segmentation-fault-core-dumped-in-python-2-7-when-importing-pyqtgraph>* >> >> ...and I am having exactly the same problem but only in Python 3.52. I >> did the "gdb Python3" step and it reported the same string issue... >> >> ... >> $ gdb python3 >> GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1 >> Copyright (C) 2016 Free Software Foundation, Inc. >> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.h >> tml> >> 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 python3...(no debugging symbols found)...done. >> (gdb) run >> Starting program: /usr/bin/python3 >> [Thread debugging using libthread_db enabled] >> Using host libthread_db library "/lib/x86_64-linux-gnu/libthre >> ad_db.so.1". >> Python 3.5.2 (default, Nov 17 2016, 17:05:23) >> [GCC 5.4.0 20160609] on linux >> Type "help", "copyright", "credits" or "license" for more information. >> >>> 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) >> >> ... >> >> >> I think the only thing I did between it working and giving a seg fault is >> that Mint update updated google Cloud SDK, but I cannot fathom what >> relationship that has except that I noticed it generated an error (did not >> note it). >> >> -- > You received this message because you are subscribed to the Google Groups > "pyqtgraph" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to pyqtgraph+unsubscr...@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/pyqtgraph/7dfc2615-201f-45ce-b576-a540b582a8aa%40googlegroups.com > <https://groups.google.com/d/msgid/pyqtgraph/7dfc2615-201f-45ce-b576-a540b582a8aa%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "pyqtgraph" group. To unsubscribe from this group and stop receiving emails from it, send an email to pyqtgraph+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/CACZXET8saSZa9hTVPrPRWETc4HX7ky5R3CMM9qDq94fG6yCvOQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.