Error while running salome_meca 2019 on ubuntu 24.04

Dear all,

I am trying use salome_meca 2019 on Ubuntu 24.04. Similar to the previous posts, I get the following error when I want to run the programme. I read the posts regarding the issue with salome_meca 9. However, due to the differences between versions, I do not know how to follow the procedure suggested there for my own version and how to solve the issue. Can anyone please kindly provide we with some guidelines?

:~/salome_meca2019_2/appli_V2019.0.3_universal$ ./salome
Traceback (most recent call last):
File “/home/d26475ak/salome_meca2019_2/appli_V2019.0.3_universal/.salome_run”, line 72, in
main(args)
File “/home/d26475ak/salome_meca2019_2/appli_V2019.0.3_universal/.salome_run”, line 47, in main
from salomeContext import SalomeContext
File “/home/d26475ak/salome_meca2019_2/appli_V2019.0.3_universal/bin/salome/salomeContext.py”, line 26, in
from parseConfigFile import parseConfigFile
File “/home/d26475ak/salome_meca2019_2/appli_V2019.0.3_universal/bin/salome/parseConfigFile.py”, line 47, in
class MultiOptSafeConfigParser(configparser.SafeConfigParser):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

you are more likely to get an answer at this forum, since it is about SALOME_MECA.

Thank you so much. I will post it there as well.
Just I think the errors are similar. Do you have any suggestions if it was for Salome? It may also work for me.

That’s true, however the underlying error is due to the used python >=3.12 for running SALOME_MECA.

All you have to do is open /home/d26475ak/salome_meca2019_2/appli_V2019.0.3_universal/bin/salome/parseConfigFile.py and then modify the the line where the “configparser.SafeConfigParser” is imported.

Basically on top of the file you will find where “import configparser” is and then add the following

import configparser 
import sys
if sys.version_info[:2] >= (3,12): 
  from configparser import ConfigParser as SafeConfigParser 
else: 
  from configparser import SafeConfigParser

So you have to modify the line 47, basically rename “configparser.SafeConfigParser” to “SafeConfigParser” and on top of the file add the lines mentioned above.

Additionally depending on the dynamic links, SALOME_MECA 2019 might not work on ubuntu 24.04.

Thank you very much for your suggestion. Unfortunately, when I am trying to open this file, I get the message that the file cannot be opened!

I think maybe yes. I wanted to check a code which was written and run with V 2019 and in V2024 it gave me some errors. Now, I am going to try with V2021. I think this is much similar to 2019 and it may be helpful.

Again, thank you all for your prompt reply and valuable suggestions.