Mantid 5.1 crash at start on unbuntu 18.04

No way to run mantid 5.1 on unbuntu 18.04

mantid 5.1.x was installed with an usual apt-get on Ubuntu 18.04.

At start it crashes systematically with the following errors:

 /opt/mantidnightly/bin/mantidworkbench
Setup tools is >= 49. You may run into issues with a clean build.
If you are failing to launch with missing modules see https://github.com/mantidproject/mantid/issues/29010
FrameworkManager-[Notice] Welcome to Mantid 5.1.20201126.1329
FrameworkManager-[Notice] Please cite: http://dx.doi.org/10.1016/j.nima.2014.07.029 and this release: http://dx.doi.org/10.5286/Software/Mantid
DownloadInstrument-[Notice] All instrument definitions up to date
Traceback (most recent call last):
  File "/opt/mantidnightly/lib/workbench/app/start.py", line 195, in start
    exit_value = start_workbench(app, options)
  File "/opt/mantidnightly/lib/workbench/app/start.py", line 130, in start_workbench
    main_window.setup()
  File "/opt/mantidnightly/lib/workbench/app/mainwindow.py", line 164, in setup
    self.ipythonconsole = JupyterConsole(self)
  File "/opt/mantidnightly/lib/workbench/plugins/jupyterconsole.py", line 46, in __init__
    font_family=font.family(), font_size=font.pointSize())
  File "/opt/mantidnightly/lib/mantidqt/widgets/jupyterconsole.py", line 60, in __init__
    shell.ex(startup_code)
  File "/usr/local/lib/python3.6/dist-packages/IPython/core/interactiveshell.py", line 2675, in ex
    exec(cmd, self.user_global_ns, self.user_ns)
  File "<string>", line 3, in <module>
  File "/usr/local/lib/python3.6/dist-packages/matplotlib/pyplot.py", line 2336, in <module>
    switch_backend(rcParams["backend"])
  File "/usr/local/lib/python3.6/dist-packages/matplotlib/pyplot.py", line 296, in switch_backend
    getattr(backend_mod, func_name))
  File "/usr/lib/python3.6/inspect.py", line 3065, in signature
    return Signature.from_callable(obj, follow_wrapped=follow_wrapped)
  File "/usr/lib/python3.6/inspect.py", line 2815, in from_callable
    follow_wrapper_chains=follow_wrapped)
  File "/usr/lib/python3.6/inspect.py", line 2372, in _signature_from_callable
    return _signature_bound_method(sig)
  File "/usr/lib/python3.6/inspect.py", line 1795, in _signature_bound_method
    raise ValueError('invalid method signature')
ValueError: invalid method signature
errorreports-[Error] Continue working.

Is there a fix to this?

Python 3.6.9
setuptools==50.3.2
matplotlib==3.3.2
ipython==7.16.1
pyqtgraph==0.10.0
qtconsole==4.7.7
QtPy==1.9.0

Hi,

The first thing to try is downgrading setuptools as there is an issue with versions 49 and above.

Can you downgrade using:

python3 -m pip install setuptools==48.0.0 

Tell me if that solves the problem or not!

Presumably, you updated it for some other piece of software. If this other version is required then you could consider using virtual envirnoments for different projects: 12. Virtual Environments and Packages — Python 3.6.13 documentation

In this case I suspect its Matplot lib looking at the stack trace, specifically when it’s switching it’s back end.

Locally I have 2.1.1, which was installed with my local Ubuntu.
@ollivier Have you upgraded / installed MPL 3.3, or installed another pip package that brought it along?

Could you try pip3 install matplotlib==2.1.1 and restarting Mantid?

Thanks for your kind help @DavidFair and @danielmurphy22.

The setuptools is not an issue since another machine with the same Ubuntu flavor has a setuptools version 39.0.1 despite the same crash problem.

Finally the solution of David was the working one. I found even that on our virtual linux Ubuntu 18.04 machines (accessible through visa.ill.fr), where the 5.1.x Mantid works, have even a more recent version of matplotlib, i.e., matplotlib==3.0.3.

After downgrading to Mpl 3.0.3 sudo -E -H pip3 install matplotlib==3.0.3, Mantid ‘5.1.20201126.1329’ workbench runs nicelly.

I’m not reluctant in enclosing each application into a “bundle” (a term from Mac OSX world) as suggested but if Mantid provides somewhere a (minimal) requirement.txt list out of pip3 freeze this could be a safe solution.

Ah, that makes sense. Looking at Launchpad we have likely started workbench with 3.1.2, but 3.3 is only shipping with 20.10 which I don’t think anyone has tested as far as I know.

@DanielMurphy22 is it worth opening an issue about MPL 3.3 causing issues? I’m sure were going to have more people run into it once 20.04 is officially supported by Mantid and people start trying out 20.10, or latest versions of Fedora

@DavidFair Sure, threw together this: Workbench won't launch on Linux with MPL 3.3 · Issue #30098 · mantidproject/mantid · GitHub