When I install "spyder", the listing of all python modules that you usually get by typing "modules" in the help() mode, segfaults:
$ python
Python 2.7.12 (default, Oct 25 2016, 17:04:12)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
help()
Welcome to Python 2.7! This is the online help utility.
If this is your first time using Python, you should definitely check out
the tutorial on the Internet at http://docs.python.org/2.7/tutorial/.
Enter the name of any module, keyword, or topic to get help on writing
Python programs and using Python modules. To quit this help utility and
return to the interpreter, just type "quit".
To get a list of available modules, keywords, or topics, type "modules",
"keywords", or "topics". Each module also comes with a one-line summary
of what it does; to list the modules whose summaries contain a given word
such as "spam", type "modules spam".
help> modules
Please wait a moment while I gather a list of all available modules...
Segmentation fault
Running gdb on the generated core gives me this stacktrace:
I would guess that it is related to this issue:
https://bugs.debian.org/cgi-bin/bugreport.cgi?att=0;bug=844601;msg=57
So libqt5gui.so segfaults when there is no qt event loop. Which is expected behaviour (say the qt developers). Why is all this qt stuff called when the modules are listed?
I have this behaviour with spyder 3.0.2 and 3.1.0 (these were the ones I tried) and I have this using qt5.7.0 or qt5.5.1.
I think this probably happens because help()
introspects PyQt5, and PyQt5 in turn loads all Qt5 libraries.
Short advice: you shouldn't use help()
. To see what modules you have installed in your system, you can run in an IPython console %reshashx
to remove a cache with your installed modules, then import <Tab>
.
I doubt there's something we can do about this, sorry.
Hi Carlos,
thanks for your answer.
Carlos Cordoba wrote on 01/21/2017 05:46 PM:
I think this probably happens because |help()| introspects PyQt5, and
PyQt5 in turn loads all Qt5 libraries.
well, no. Not really. This did not happen until I installed
spyder. So before (when PyQT5, QtPy, ... were already installed),
it still worked.
I straced the thing and can see that the python
works through the [...]/site-packages/PyQt4 and the
[...]/site-packages/PyQt5 directories before without
segfaulting. The segfault happens when it's working
through the spyder directory.
If I move the [...]/site-packages/spyder subdirectory
elsewhere (or remove it), "modules" immediately works again.
Short advice: you shouldn't use |help()|. To see what modules you have
installed in your system, you can run in an IPython console |%reshashx|
to remove a cache with your installed modules, then |import|.
well, it's not me. It's our users. Not an easy job
to tell more than 1000 people that some standard python
stuff does not work anymore...
Regrds, Olaf
--
Dipl. Inform. Olaf Gellert email [email protected]
Deutsches Klimarechenzentrum GmbH phone +49 (0)40 460094 214
Bundesstrasse 45a fax +49 (0)40 460094 270
D-20146 Hamburg, Germany www http://www.dkrz.de
@dalthviz, I think this only happens on Linux, so please test there first.
This Debian bug report may be relevant: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=844601
It basically says that the command import spyder.plugins.editor
leads to a segfault. I just reproduced this on Debian Linux.
Thanks @jitseniesen! I'm sure that will make @dalthviz easier :-)
Thanks @jitseniesen for the link 馃憤 . @ccordoba12 of what I have tested and readed, the problem is in the qtawesome
project, since there we are using the QFontDatabase without a QApplication instance. Probably this is the cause of the segmentation fault
Thanks @jitseniesen for the link
I just found out that @ocarino who reported the bug already provided the same link at the end of their message.
Could you confirm whether Bug-Debian #844601 is related to this issue, please?
Hi,
Ghislain Antony Vaillant wrote on 01/25/2017 10:23 AM:
Could you confirm whether Bug-Debian #844601
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=844601 is related to
this issue, please?
from my point of view this looks pretty much the same.
Here is my backtrace from GDB on the dumped core:
/sw/rhel6-x64/x11/qt-5.5.1-gcc48/lib/libQt5Gui.so.5
/sw/rhel6-x64/x11/qt-5.5.1-gcc48/lib/libQt5Gui.so.5
const&) () from /sw/rhel6-x64/x11/qt-5.5.1-gcc48/lib/libQt5Gui.so.5
/sw/rhel6-x64/python/python-2.7.12-gcc49/lib/python2.7/site-packages/PyQt5/QtGui.so
output of #0 and #1 looks different (obviously because there is no
debug information in our QT5 install), but besides of that: Id say
yes, that's the same as the backtrace in the Bug-Debian #844601.
Olaf
Hmm, the Debian bug is definitely related, but I just checked and the proposed fix for this issue does not fix the Debian bug. I opened a new issue for this: #4049.
@ocarino, the solution to this problem is to install qtawesome
(one of Spyder dependencies) version 0.4.4 or higher (once I release it, in a couple of days).
Thanks for letting us know about this (very!) nasty problem :-)
Hi,
Carlos Cordoba wrote:
@ocarino https://github.com/ocarino, the solution to this problem is
to install |qtawesome| (one of Spyder dependencies) version 0.4.4 or
higher (once I release it, in a couple of days).
thanks for your work. I just downloaded QtAwesome 0.4.4
(from pypi), but when I try to install it, I get an
error. I try to install it in python 2.7.12 on a centos6
system. Here is the end of the build output:
byte-compiling build/bdist.linux-x86_64/egg/qtawesome/__init__.py to
__init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/qtawesome/_version.py to
_version.pyc
byte-compiling
build/bdist.linux-x86_64/egg/qtawesome/tests/test_qtawesome.py to
test_qtawesome.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying QtAwesome.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying QtAwesome.egg-info/SOURCES.txt ->
build/bdist.linux-x86_64/egg/EGG-INFO
copying QtAwesome.egg-info/dependency_links.txt ->
build/bdist.linux-x86_64/egg/EGG-INFO
copying QtAwesome.egg-info/requires.txt ->
build/bdist.linux-x86_64/egg/EGG-INFO
copying QtAwesome.egg-info/top_level.txt ->
build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
qtawesome.iconic_font: module references __file__
Traceback (most recent call last):
File "setup.py", line 76, in
'Programming Language :: Python :: 3.4',]
File
"/sw/rhel6-x64/python/python-2.7.12-gcc49/lib/python2.7/distutils/core.py",
line 151, in setup
dist.run_commands()
File
"/sw/rhel6-x64/python/python-2.7.12-gcc49/lib/python2.7/distutils/dist.py",
line 953, in run_commands
self.run_command(cmd)
File
"/sw/rhel6-x64/python/python-2.7.12-gcc49/lib/python2.7/distutils/dist.py",
line 972, in run_command
cmd_obj.run()
File "build/bdist.linux-x86_64/egg/setuptools/command/install.py",
line 67, in run
File "build/bdist.linux-x86_64/egg/setuptools/command/install.py",
line 109, in do_egg_install
File
"/sw/rhel6-x64/python/python-2.7.12-gcc49/lib/python2.7/distutils/cmd.py",
line 326, in run_command
self.distribution.run_command(command)
File
"/sw/rhel6-x64/python/python-2.7.12-gcc49/lib/python2.7/distutils/dist.py",
line 972, in run_command
cmd_obj.run()
File "build/bdist.linux-x86_64/egg/setuptools/command/bdist_egg.py",
line 209, in run
File "build/bdist.linux-x86_64/egg/setuptools/command/bdist_egg.py",
line 245, in zip_safe
File "build/bdist.linux-x86_64/egg/setuptools/command/bdist_egg.py",
line 355, in analyze_egg
File "build/bdist.linux-x86_64/egg/setuptools/command/bdist_egg.py",
line 392, in scan_module
ValueError: bad marshal data (unknown type code)
Thanks for any help...
Cheers, Olaf
It seems you have an old version of setuptools. Why don't you use pip
?