Invesalius crashes at startup @ Ubuntu 18.04

Bug #1770595 reported by Renat on 2018-05-11
This bug affects 1 person
Affects Status Importance Assigned to Milestone
invesalius (Ubuntu)

Bug Description

Ubuntu 18.04 x 64, clean installation, tested on two different notebooks and in one VM, problem persists everywhere.
Invesalius 3.1.1-1~xenial was installed from Ubuntu own repository, but, when you try to start this program, it's splash screen appears for a moment, then disappears, and that's it. No window to create crash report, nothing. Like this:

By the way, same problem was with Ubuntu 16.04, if you'll not install invesalius-bin package (.deb files were obtained from Invesalius site in that case). In Ubuntu 18.04 installation of this package doesn't help, though.

tfmoraes (tfmoraes) wrote :

Hi, InVesalius developer here.

I don' t know why it is happening yet. But if you use KDE as desktop (maybe other too) InVesalius runs correctly. You can try to run Invesalius by the code, it will run in Gnome. First, install wxPython4:

$ sudo apt install python-wxgtk4.0

Download the code from github . In the terminal, enter in the invesalius3 folder, then:

$ export PYTHONPATH=/usr/lib/python2.7/dist-packages/wxPython-4.0.1-py2.7-linux-amd64.egg
$ python

When I have time, I'll upload a package of git invesalius version to the ppa.

Renat (deymos34) wrote :

Hi Thiago, thank you for this suggestion - and for this app. Unfortunately, aforemetioned workaround doesn't seems to work for me:

renat@renat-Lenovo-B50-80:~$ cd ~/dev/invesalius3
renat@renat-Lenovo-B50-80:~/dev/invesalius3$ export PYTHONPATH=/usr/lib/python2.7/dist-packages/wxPython-4.0.1-py2.7-linux-amd64.egg
renat@renat-Lenovo-B50-80:~/dev/invesalius3$ python

          *** ATTENTION ***
This messaging protocol is deprecated. This module, and hence arg1
messaging protocol, will be removed in v3.4 of PyPubSub. Please make
the necessary changes to your code so that it no longer requires this
module. The pypubsub documentation provides steps that may be useful
to minimize the chance of introducing bugs in your application.

/home/renat/dev/invesalius3/invesalius/data/ UserWarning: failed to import module _transformations
  warnings.warn("failed to import module %s" % name)
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/wxPython-4.0.1-py2.7-linux-amd64.egg/wx/", line 2158, in Notify
  File "/usr/lib/python2.7/dist-packages/wxPython-4.0.1-py2.7-linux-amd64.egg/wx/", line 3315, in Notify
    self.result = self.callable(*self.args, **self.kwargs)
  File "", line 240, in Startup
    from invesalius.gui.frame import Frame
  File "/home/renat/dev/invesalius3/invesalius/gui/", line 41, in <module>
    import invesalius.gui.default_tasks as tasks
  File "/home/renat/dev/invesalius3/invesalius/gui/", line 28, in <module>
    import invesalius.gui.data_notebook as nb
  File "/home/renat/dev/invesalius3/invesalius/gui/", line 41, in <module>
    import as slice_
  File "/home/renat/dev/invesalius3/invesalius/data/", line 34, in <module>
    from import Mask
  File "/home/renat/dev/invesalius3/invesalius/data/", line 33, in <module>
    from . import floodfill
ImportError: cannot import name floodfill
Traceback (most recent call last):
  File "", line 264, in OnClose
    if self.fc.IsRunning():
AttributeError: 'Inv3SplashScreen' object has no attribute 'fc'
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/wxPython-4.0.1-py2.7-linux-amd64.egg/wx/", line 2158, in Notify
  File "/usr/lib/python2.7/dist-packages/wxPython-4.0.1-py2.7-linux-amd64.egg/wx/", line 3315, in Notify
    self.result = self.callable(*self.args, **self.kwargs)
  File "", line 123, in Startup2
    self.control = self.splash.control
AttributeError: 'Inv3SplashScreen' object has no attribute 'control'

Declan Moriarty (business-kid) wrote :

Hi. I'm running Mint-19.0 Tara, based largely on Ubuntu debs. I can confirm the bug. 1st time, it takes 3-4 seconds. It's a fresh install, duly updated & upgraded. I tried running it from a terminal, and got this:
dec@RoseViolet:~$ invesalius3
/usr/share/invesalius/invesalius/data/ UserWarning: failed to import module _transformations
  warnings.warn("failed to import module %s" % name)
session mode: 0

( Gtk-CRITICAL **: 10:54:57.255: gtk_widget_set_size_request: assertion 'width >= -1' failed
Segmentation fault

Looking at that, the offending routine is below:
def _import_module(name, package=None, warn=True, prefix='_py_', ignore='_'):
    """Try import all public attributes from module into global namespace.

    Existing attributes with name clashes are renamed with prefix.
    Attributes starting with underscore are ignored by default.

    Return True on successful import.

    import warnings
    from importlib import import_module
        if not package:
            module = import_module(name)
            module = import_module('.' + name, package=package)
    except ImportError:
        if warn:
1899 ===>>> warnings.warn("failed to import module %s" % name) <<<=== 1899
        for attr in dir(module):
            if ignore and attr.startswith(ignore):
            if prefix:
                if attr in globals():
                    globals()[prefix + attr] = globals()[attr]
                elif warn:
                    warnings.warn("no Python implementation of " + attr)
            globals()[attr] = getattr(module, attr)
        return True
I'm no python expert, but I gather it's a dependency issue. I also tried the debian .deb, but got exactly the same fault(segfault after 3-4 seconds). It's a pity, it's a well recommended piece of kit. As I was trying packages, I did a 'purge' on each one followed by an 'autoremove'. I have a few VMs (Mint, Vista, W10), but because there's a fault noted in W64 (, line 146) I'm not tempted to try a windows version.

tfmoraes (tfmoraes) wrote :

Hi Renat, sorry I didn't see your comment. Your problem is because you need to compile some cython files we use in InVesalius. You need to enter in InVesalius source code then run:

$ python3 build_ext --inplace

Then you can use InVesalius.

I created a PPA to InVesalius, I think it's better to use the InVesalius from there.

tfmoraes (tfmoraes) wrote :

Hi Declan Moriarty, that is just a warning, that is not the source of this problem. The problem is the VTK interface with WXPython3. Using VTK with WXPython4 fix this problem. I create a PPA with this problem fixed. Try the InVesalius from there

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers