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
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.
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.
The issue seems due to Python 3.12 where configparser.SafeConfigParser has been removed. It is deprecated since 3.2 but without warning message
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).