When running the same commands from a terminal window Python interpreter, the command runs to completion without incident. Both show the same version number 2.7.13
If I were to issue FreeCAD from the terminal window, the gui window comes up, I run the help()/modules command, the gui window closes and in the terminal window I see:
<snip>
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from FreeCAD...Reading symbols from /usr/lib/debug/usr/lib64/freecad/bin/FreeCAD.debug...done.
done.
(gdb)
However the gui does not come up to try the help()/modules command.
Fasteners workbench Loaded
Sheet Metal workbench loaded
[New Thread 0x7fff77a8c700 (LWP 25585)]
[New Thread 0x7fff7728b700 (LWP 25586)]
[New Thread 0x7fff7685c700 (LWP 25587)]
[New Thread 0x7fff75982700 (LWP 25588)]
[New Thread 0x7fff67fff700 (LWP 25589)]
[New Thread 0x7fff677fe700 (LWP 25590)]
[New Thread 0x7fff66ffd700 (LWP 25591)]
matplotlib not found, so Plot module can not be loaded <--does not appear until after modules <enter>
matplotlib not found, so Plot module can not be loaded
matplotlib not found, so Plot module can not be loaded
matplotlib not found, so Plot module can not be loaded
matplotlib not found, so Plot module can not be loaded
dm.c: 1693: not running as root returning empty list
[New Thread 0x7fff3ddb4700 (LWP 25677)]
[Thread 0x7fff66ffd700 (LWP 25591) exited]
[Thread 0x7fff677fe700 (LWP 25590) exited]
Detaching after fork from child process 25715.
Detaching after fork from child process 25734.
Detaching after fork from child process 25736.
Thread 1 "FreeCAD" received signal SIGSEGV, Segmentation fault.
0x00007fff0c48b9d5 in init_libpycomps ()
from /usr/lib64/python2.7/site-packages/libcomps/_libpycomps.so
Missing separate debuginfos, use: dnf debuginfo-install GConf2-3.2.6-16.fc24.x86_64 ORBit2-2.14.19-15.fc24.x86_64 OpenEXR-libs-2.2.0-5.fc24.x86_64 PyQt4-4.11.4-15.fc25.x86_64 PyQwt-5.2.0-32.fc25.x86_64 SDL-1.2.15-21.fc24.x86_64 aqbanking-5.6.12-1.fc25.x86_64 at-spi2-atk-2.22.0-1.fc25.x86_64 at-spi2-core-2.22.0-1.fc25.x86_64 atk-2.22.0-1.fc25.x86_64 atlas-3.10.2-14.fc25.x86_64 avahi-glib-0.6.32-4.fc25.x86_64 avahi-libs-0.6.32-4.fc25.x86_64 cyrus-sasl-lib-2.1.26-26.2.fc24.x86_64 dbus-glib-0.108-1.fc25.x86_64 dbus-python-1.2.4-2.fc25.x86_64 dconf-0.26.0-1.fc25.x86_64 device-mapper-event-libs-1.02.136-3.fc25.x86_64 device-mapper-libs-1.02.136-3.fc25.x86_64 dmraid-1.0.0.rc16-30.fc24.x86_64 elfutils-libelf-0.168-1.fc25.x86_64 enchant-1.6.0-14.fc25.x86_64 fftw-libs-single-3.3.5-3.fc25.x86_64 flac-libs-1.3.2-1.fc25.x86_64 gamin-0.1.10-23.fc25.x86_64 gc-7.4.4-1.fc25.x86_64 gdk-pixbuf2-2.36.4-1.fc25.x86_64
<<snip>>
.10-1.fc25.x86_64 libtdb-1.3.11-1.fc25.x86_64 libtool-ltdl-2.4.6-13.fc25.x86_64 libunistring-0.9.4-3.fc24.x86_64 libusbx-1.0.21-1.fc25.x86_64 libxkbcommon-0.7.1-1.fc25.x86_64 llvm-libs-3.8.1-2.fc25.x86_64 lua-libs-5.3.3-3.fc25.x86_64 nettle-3.3-1.fc25.x86_64 nspr-4.13.1-1.fc25.x86_64 nss-3.28.1-1.3.fc25.x86_64 nss-mdns-0.10-17.fc24.x86_64 nss-util-3.28.1-1.0.fc25.x86_64 openjpeg2-2.1.2-3.fc25.x86_64 openldap-2.4.44-2.fc25.x86_64 opensp-1.5.2-23.fc24.x86_64 openssl-libs-1.0.2j-3.fc25.x86_64 p11-kit-0.23.2-2.fc24.x86_64 phonon-4.9.0-3.fc25.x86_64 popt-1.16-7.fc24.x86_64 portaudio-19-23.fc24.x86_64 pulseaudio-libs-10.0-2.fc25.x86_64 pulseaudio-libs-glib2-10.0-2.fc25.x86_64 pycairo-1.10.0-5.fc25.x86_64 python-cheetah-2.4.4-13.fc25.x86_64 python-gobject-base-3.22.0-1.fc25.x86_64 python-gssapi-1.2.0-2.fc25.x86_64 python-pivy-0.5.0-13.hg609.fc25.x86_64 python-pyblock-0.53-8.fc22.x86_64 python-pycurl-7.43.0-4.fc25.x86_64 python-pyside-1.2.2-6.fc25.x86_64 python2-cffi-1.7.0-2.fc25.x86_64 python2-coverage-4.2-1.fc25.x86_64 python2-crypto-2.6.1-13.fc25.x86_64 python2-cryptography-1.5.3-3.fc25.x86_64 python2-hawkey-0.6.3-6.1.fc25.x86_64 python2-libcomps-0.1.7-5.fc25.x86_64 python2-lxml-3.7.2-1.fc25.x86_64 python2-matplotlib-1.5.2-0.2.rc2.fc25.x86_64 python2-numpy-1.11.2-1.fc25.x86_64 python2-pillow-3.4.2-1.fc25.x86_64 python2-pygpgme-0.3-18.fc25.x86_64 python2-pyopengl-3.1.1a1-5.fc25.x86_64 python2-scipy-0.18.0-1.fc25.x86_64 qwt-6.1.2-5.fc24.x86_64 qwt5-qt4-5.2.2-29.fc24.x86_64 rpm-libs-4.13.0-6.fc25.x86_64 sip-4.18.1-1.fc25.x86_64 tcp_wrappers-libs-7.6-83.fc25.x86_64 uhd-3.10.1.0-1.fc25.x86_64 webkitgtk-2.4.11-3.fc25.x86_64 webkitgtk3-2.4.11-3.fc25.x86_64 wxBase3-3.0.2-32.fc25.x86_64 wxGTK3-3.0.2-32.fc25.x86_64 wxGTK3-gl-3.0.2-32.fc25.x86_64 wxPython-3.0.2.0-11.fc25.x86_64
(gdb) bt
#0 0x00007fff0c48b9d5 in init_libpycomps ()
at /usr/lib64/python2.7/site-packages/libcomps/_libpycomps.so
#1 0x00007ffff66d15fc in _PyImport_LoadDynamicModule (name=name@entry=0x6309790 "libcomps._libpycomps", pathname=pathname@entry=0x6301740 "/usr/lib64/python2.7/site-packages/libcomps/_libpycomps.so", fp=<optimized out>) at /usr/src/debug/Python-2.7.13/Python/importdl.c:53
#2 0x00007ffff66cf383 in load_module (name=name@entry=0x6309790 "libcomps._libpycomps", fp=<optimized out>, pathname=pathname@entry=0x6301740 "/usr/lib64/python2.7/site-packages/libcomps/_libpycomps.so", type=<optimized out>, loader=<optimized out>)
at /usr/src/debug/Python-2.7.13/Python/import.c:1937
#3 0x00007ffff66cf641 in import_submodule (mod=mod@entry=<module at remote 0x7fff0f2b78d8>, subname=subname@entry=0x6309799 "_libpycomps", fullname=fullname@entry=0x6309790 "libcomps._libpycomps")
at /usr/src/debug/Python-2.7.13/Python/import.c:2725
#4 0x00007ffff66cf8ba in load_next (mod=mod@entry=<module at remote 0x7fff0f2b78d8>, altmod=<module at remote 0x7fff0f2b78d8>, p_name=p_name@entry=0x7fffffff9ff8, buf=buf@entry=0x6309790 "libcomps._libpycomps", p_buflen=p_buflen@entry=0x7fffffffa000)
at /usr/src/debug/Python-2.7.13/Python/import.c:2539
#5 0x00007ffff66d02a3 in import_module_level (locals=<optimized out>, level=<optimized out>, fromlist=('*',), globals=<optimized out>, name=<optimized out>)
at /usr/src/debug/Python-2.7.13/Python/import.c:2247
#6 0x00007ffff66d02a3 in PyImport_ImportModuleLevel (name=<optimized out>, globals=<optimized out>, locals=<optimized out>, fromlist=('*',), level=<optimized out>)
at /usr/src/debug/Python-2.7.13/Python/import.c:2312
#7 0x00007ffff66b2fb8 in builtin___import__ (self=<optimized out>, args=<optimized out>, kwds=<optimized out>) at /usr/src/debug/Python-2.7.13/Python/bltinmodule.c:49
#8 0x00007ffff6622003 in PyObject_Call (func=func@entry=<built-in function __import__>, arg=arg@entry=('_libpycomps', {'__builtins__': {'bytearray': <type at remote 0x7ffff695dea0>, 'IndexError': <type at remote 0x7ffff6964b00>, 'all': <built-in function all>, 'help': <_Helper at remote 0x7ffff7e18650>, 'vars': <built-in function vars>, 'SyntaxError': <type at remote 0x7ffff6965180>, 'unicode': <type at remote 0x7ffff697b320>, 'UnicodeDecodeError': <type at remote 0x7ffff69641e0>, 'memoryview': <type at remote 0x7ffff696f360>, 'isinstance': <built-in function isinstance>, 'copyright': <_Printer(_Printer__data='Copyright (c) 2001-2016 Python Software Foundation.\nAll Rights Reserved.\n\nCopyright (c) 2000 BeOpen.com.\nAll Rights Reserved.\n\nCopyright (c) 1995-2001 Corporation for National Research Initiatives.\nAll Rights Reserved.\n\nCopyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.\nAll Rights Reserved.', _Printer__lines=None, _Printer__name='copyright', _Printer__dirs=(), _Printer__files=(...)) at remote 0x7ffff7e18110>, 'NameError': <type at remote 0x7ffff6965780>, 'BytesWarning': <type a...(truncated), kw=<optimized out>)
at /usr/src/debug/Python-2.7.13/Objects/abstract.c:2547
#9 0x00007ffff66b4bc7 in PyEval_CallObjectWithKeywords (func=func@entry=<built-in function __import__>, arg=arg@entry=('_libpycomps', {'__builtins__': {'bytearray': <type at remote 0x7ffff695dea0>, 'IndexError': <type at remote 0x7ffff6964b00>, 'all': <built-in function all>, 'help': <_Helper at remote 0x7ffff7e18650>, 'vars': <built-in function vars>, 'SyntaxError': <type at remote 0x7ffff6965180>, 'unicode': <type at remote 0x7ffff697b320>, 'UnicodeDecodeError': <type at remote 0x7ffff69641e0>, 'memoryview': <type at remote 0x7ffff696f360>, 'isinstance': <built-in function isinstance>, 'copyright---Type <return> to continue, or q <return> to quit---
Thread 1 "FreeCAD" received signal SIGSEGV, Segmentation fault.
0x00007fff0c48b9d5 in init_libpycomps ()
from /usr/lib64/python2.7/site-packages/libcomps/_libpycomps.so
So, in other words the crash is not directly related to FreeCAD. This means that FreeCAD loads this module due to the call of "modules" but inside its init function something bad happens.
Basically nothing happens of note. Both fail unremarkably and in the same way.
Question: And do you have an idea what this Python module is good for?
Answer: No idea, it is not something I'm trying to use, nor think I need. Something in the bowels somewhere decides to add it in.
[ruchg@linuxHost ~]$ python
Python 2.7.13 (default, Jan 12 2017, 17:59:37)
[GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import _libpycomps
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named _libpycomps
>>>
Python 2.7.13 (default, Jan 12 2017, 17:59:37)
[GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux2
Type 'help', 'copyright', 'credits' or 'license' for more information.
>>> import WebGui
>>> from StartPage import StartPage
>>> WebGui.openBrowserHTML(StartPage.handle(),'file://' + App.getResourceDir() + 'Mod/Start/StartPage/','Start page')
>>> import _libpycomps
Traceback (most recent call last):
File "<input>", line 1, in <module>
ImportError: No module named _libpycomps
>>>
On the off chance that there are two underscores instead of one, I re-tried both methods using the double underscore. I get back the same file not found import error.
Out of curiosity I checked the library file it exists and seems OK
OS: Ubuntu 18.04 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13522 (Git)
Build type: None
Branch: releases/FreeCAD-0-17
Hash: 3bb5ff4e70c0c526f2d9dd69b1004155b2f527f2
Python version: 2.7.15rc1
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: English/UnitedStates (en_US)
I am learning FreeCAD 0.17 and following the step by step tutorial in freecadweb.org. One of the steps was to see what modules were available within python 2.7 inside FreeCAD. So the command was to type: help(). That produced the following message in the Python console window:
Welcome to Python 2.7! This is the online help utility.
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".
This text was grey-color. Following this, there was one blank line, and then I saw:
help>
It was also grey-color text. On that line, I typed "modules" (without the quotation marks). After waiting about 20 seconds, FreeCAD quit completely.
I re-started FreeCAD and retried. This time, I typed "modules" (including the quotation marks). The same result....after about 20 seconds, FreeCAD quit completely.
I have not completely understood the above conversations from 2017, but I hope that this is the place to find out what happened. Is there is some sort of way to find out what modules are available, as I learn python within FreeCAD? ( I am a newbie to python, and still learning FreeCAD.)
Any help would be appreciated.
Cheers!
C:\Program Files\FreeCAD 0.17\bin\lib\site-packages\matplotlib\cbook.py:137: MatplotlibDeprecationWarning: The matplotlib.delaunay module was deprecated in version 1.4. Use matplotlib.tri.Triangulation instead.
warnings.warn(message, mplDeprecation, stacklevel=1)
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13519 (Git)
Build type: Release
Branch: releases/FreeCAD-0-17
Hash: 1a8b868018f45ea486c0023fdbfeb06febc1fb89
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: English/UnitedStates (en_US)