Running Linux Universal v9.12.0 binary on Gentoo

I have unpacked the Universial Linux distribution of current Salome.

Unfortunately, I am facing an error early after starting the application. The output is listed below. I tried both, salome and mesa_salome startup scripts. The reason might be that Gentoo uses Python-3.12. I haven’t used Salome for a while and the Python update on my Gentoo box has come in between.

I scrolled through the salome startup script, but did not find the spot where I could configure to use the Python version that ships with the Salome installation.

Is there anything that can be done about this?

$ ~/bin/SALOME-9.12.0/salome
Traceback (most recent call last):
  File "/home/*****/bin/SALOME-9.12.0/salome", line 71, in main
    from salomeContext import SalomeContext, SalomeContextException
  File "/home/*****/bin/SALOME-9.12.0/BINARIES-CO7/KERNEL/bin/salome/salomeContext.py", line 26, in <module>
    from parseConfigFile import parseConfigFile
  File "/home/*****/bin/SALOME-9.12.0/BINARIES-CO7/KERNEL/bin/salome/parseConfigFile.py", line 49, in <module>
    class MultiOptSafeConfigParser(configparser.SafeConfigParser):
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'configparser' has no attribute 'SafeConfigParser'. Did you mean: 'RawConfigParser'?

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/*****/bin/SALOME-9.12.0/salome", line 1266, in <module>
    main(args)
  File "/home/*****/bin/SALOME-9.12.0/salome", line 1258, in main
    except SalomeContextException as e:
           ^^^^^^^^^^^^^^^^^^^^^^
UnboundLocalError: cannot access local variable 'SalomeContextException' where it is not associated with a value
1 Like

can you try:

source SALOME-9.12.0/env_launch.sh
SALOME-9.12.0/salome

and let us know if it fixes the reported issue.

Thank you, Nabil. Now I can briefly see Salome’s splash screen. But after a while, the command prompt returns without error message.

I opened a new console window and in fact, after running your suggested commands, I get the error message again and no splash screen occurs. The previous reported behaviour was due to the fact that I manually changed the interpreter line in salome to SALOME-9.12.0/BINARIES-CO7/Python/bin/python. I undid that and now I get the original behaviour, also with your commands.

I replied before your second comment. Thus I don’t know whether the following applies.

Are you running wayland?
If yes, please see how to switch to x11 as described in other threads.

Good old X11 runs on my box.

Just before I try to run it on some gentoo container to check if i can reproduce the issue.
You tried to run:

source SALOME-9.12.0/env_launch.sh
SALOME-9.12.0/mesa_salome

and this command returns on error with the first error message you shared?
If yes, can you:

  • share the output of cat /etc/os-release
  • share the list of installed packages on your gentoo

Thanks

Thank you, Nabil! Yes, in a fresh terminal I ran

source SALOME-9.12.0/env_launch.sh
SALOME-9.12.0/mesa_salome

with the error output listed above.

Then I have:

$ cat /etc/os-release 
NAME=Gentoo
ID=gentoo
PRETTY_NAME="Gentoo Linux"
ANSI_COLOR="1;32"
HOME_URL="https://www.gentoo.org/"
SUPPORT_URL="https://www.gentoo.org/support/"
BUG_REPORT_URL="https://bugs.gentoo.org/"
VERSION_ID="2.15"

And this is the list of installed packages:

packages.txt (45.0 KB)

1 Like

Really just an FYI, i have the same fleeting splash screen as above on Manjaro
(but for all i know, it may be more or less the same thing as Gentoo: i’m not really
all that computer savvy).
It is freshly installed and, as far as i can tell, completely up-to-date.

cat /etc/os-release
NAME=“Manjaro Linux”
PRETTY_NAME=“Manjaro Linux”
ID=manjaro
ID_LIKE=arch
BUILD_ID=rolling

(the rest simply being links that i, as a complete novice, may not post, probably rightly).

Hello,

The issue seems due to Python 3.12 where configparser.SafeConfigParser has been removed. It is deprecated since 3.2 but without warning message :frowning:

I’m not familiar with the Universal version, but it should come with its own Python.
So if you load the environment first, by sourcing the env_launch.sh file as NabilG explained, then it should use the internal Python instead of the local one (Try which python to check).
If it is not the case then remove path to your local python from the environment.

Another solution could be to “fix” the issue with SafeConfigParser:

  • edit the file SALOME-9.12.0/BINARIES-CO7/KERNEL/bin/salome/parseConfigFile.py
  • replace configparser.SafeConfigParser with configparser.ConfigParser
  • do the same with SALOME-9.12.0/BINARIES-CO7/SALOME/bin/salome/parseConfigFile.py

I made quick tests and I had no errors (but I’m testing on Ubuntu 22 with Python 3.10).