Issue running Salome at 22.04

I’ve been getting the following error trying to run Salome. Tried Ubuntu and generic Linux versions:

/home/forti/Downloads/SALOME-9.12.0/BINARIES-CO7/KERNEL/bin/salome/salomeContextUtils.py:184: SyntaxWarning: invalid escape sequence ‘[’
contains_list = re.findall(‘([[^]]])', elt)
/home/forti/Downloads/SALOME-9.12.0/BINARIES-CO7/KERNEL/bin/salome/salomeContextUtils.py:301: SyntaxWarning: invalid escape sequence ‘\ ’
cmd = cmd.replace(’ ', '\ ‘).replace(’\ ', ’ ', 1)
/home/forti/Downloads/SALOME-9.12.0/BINARIES-CO7/KERNEL/bin/salome/salomeContextUtils.py:301: SyntaxWarning: invalid escape sequence ‘\ ’
cmd = cmd.replace(’ ', '\ ‘).replace(’\ ', ’ ‘, 1)
/home/forti/Downloads/SALOME-9.12.0/BINARIES-CO7/KERNEL/bin/salome/parseConfigFile.py:40: SyntaxWarning: invalid escape sequence ‘$’
pattern = re.compile(’${ ( [^}]
) }’, re.VERBOSE) # string enclosed in ${ and }
Traceback (most recent call last):
File “/home/forti/Downloads/SALOME-9.12.0/./salome”, line 71, in main
from salomeContext import SalomeContext, SalomeContextException
File “/home/forti/Downloads/SALOME-9.12.0/BINARIES-CO7/KERNEL/bin/salome/salomeContext.py”, line 26, in
from parseConfigFile import parseConfigFile
File “/home/forti/Downloads/SALOME-9.12.0/BINARIES-CO7/KERNEL/bin/salome/parseConfigFile.py”, line 49, in
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/forti/Downloads/SALOME-9.12.0/./salome”, line 1266, in
main(args)
File “/home/forti/Downloads/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

hard to guess - but can you:

  • try universal binary with mesa_salome launcher instead and report if it also fails
  • output of cat /etc/os-release
  • share the output of apt list --installed
  • share the error you get with SALOME-9.12.0-native-UB22.04 ?

Result from mesa:
Traceback (most recent call last):
File “/home/forti/ProgramFiles/SALOME-9.12.0-native-UB22.04-SRC/./mesa_salome”, line 71, in main
from salomeContext import SalomeContext, SalomeContextException
File “/home/forti/ProgramFiles/SALOME-9.12.0-native-UB22.04-SRC/BINARIES-UB22.04/KERNEL/bin/salome/salomeContext.py”, line 26, in
from parseConfigFile import parseConfigFile
File “/home/forti/ProgramFiles/SALOME-9.12.0-native-UB22.04-SRC/BINARIES-UB22.04/KERNEL/bin/salome/parseConfigFile.py”, line 49, in
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/forti/ProgramFiles/SALOME-9.12.0-native-UB22.04-SRC/./mesa_salome”, line 1075, in
main(args)
File “/home/forti/ProgramFiles/SALOME-9.12.0-native-UB22.04-SRC/./mesa_salome”, line 1067, in main
except SalomeContextException as e:
^^^^^^^^^^^^^^^^^^^^^^
UnboundLocalError: cannot access local variable ‘SalomeContextException’ where it is not associated with a value

cat /etc/os-release:
PRETTY_NAME=“KDE neon 6.0”
NAME=“KDE neon”
VERSION_ID=“22.04”
VERSION=“6.0”
VERSION_CODENAME=jammy
ID=neon
ID_LIKE=“ubuntu debian”
HOME_URL=“https://neon.kde.org/
SUPPORT_URL=“https://neon.kde.org/
BUG_REPORT_URL=“https://bugs.kde.org/
PRIVACY_POLICY_URL=“KDE.org Privacy Policy - KDE Community
UBUNTU_CODENAME=jammy
LOGO=start-here-kde-neon

apt list --installed

inst.txt (167.9 KB)

First,
running ‘./sat/sat config SALOME-9.12.0 --check_system’ still gives:
Unknown distribution: ‘not found’
Please add your distribution to src/internal_config/distrib.pyconf

Also, after a few step backs, I’ve installed manually a few dependencies.
These from old experience:
sudo apt install -y libcdt5
sudo apt install -y libcgraph6
sudo apt install -y libgvc6
sudo apt install -y libboost-system1.74.0
sudo apt install -y libqt5help5
sudo apt install -y libopenblas0
sudo apt install -y libcminpack1
sudo apt install -y libfreeimage3
sudo apt install -y libboost-all-dev

These are new:
sudo apt install python3-pip
pip install packaging

error: /usr/bin/env: ‘python’: No such file or directory
sudo ln -s /usr/bin/python3 /usr/bin/python

sudo apt install -y libtbb-dev

now, it is working.

I see. Indeed here is what you should do.

In case you’re using SALOME-9.12.0-native-UB22.04, then you need to run:

sat/sat config SALOME-9.12.0-native --check_system

and install the missing packages using the apt utility.

On the other hand if you’re using the universal binary, then you need, as described in the README, to uncomment one line in the launcher to use the embedded system dependencies.

In addition, you should not do this symbolic link about python3.

You need to install this package instead (remove the symbolic link you set before)

sudo apt install python-is-python3

Regards

Problem is that this command gives to me (same thing when I was using Mint):

Unknown distribution: ‘not found’
Please add your distribution to src/internal_config/distrib.pyconf

So, I basically have to try running and catch what is missing.

It seems that linux_distribution does not return Ubuntu which makes SAT complain.
Can you

  • install python3-distro
  • run:
python3
from distro import linux_distribution
print(linux_distribution)

and share the output.
Then we can update SAT to support this platform. Thanks.

forti@QuintalSoftHouse:~$ python3
Python 3.11.8 (main, Feb 25 2024, 16:39:33) [GCC 11.4.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

from distro import linux_distribution
print(linux_distribution)
<function linux_distribution at 0x7133266c44a0>

It is a python function You need to add () so:

from distro import linux_distribution 
print(linux_distribution()) 
1 Like

Rather sorry the typo, I mistyped the command. As spotted by Franco, you need to run the following command line and share the output. Thanks.

 from distro import linux_distribution
print(linux_distribution())

:1: DeprecationWarning: distro.linux_distribution() is deprecated. It should only be used as a compatibility shim with Python’s platform.linux_distribution(). Please use distro.id(), distro.version() and distro.name() instead.
(‘KDE neon’, ‘22.04’, ‘jammy’)

1 Like

I see. Here you need to edit the following file:

SALOME-master-native-UB22.04-SRC/sat/src/internal_config/distrib.pyconf

and add to the DISTRIBUTIONS dictionary, this line:

  "kde neon" :  "UB"

Then you can check whether this command returns successfully:

sat/sat config SALOME-9.12.0-native --check_system

Can you confirm it works ?
In the long term, I believe we need to rely on some more robust mechanism to figure out which flavor of Linux is in use.

Thanks.

Hello nabil,
I jump in the conversation as I had a similar issue, from python I am getting:

print(linux_distribution())
<stdin>:1: DeprecationWarning: distro.linux_distribution() is deprecated. It should only be used as a compatibility shim with Python's platform.linux_distribution(). Please use distro.id(), distro.version() and distro.name() instead.
('TUXEDO OS', '22.04', 'jammy')

so in theory, I should add to $salome_path/sat/src/distrib.pyconf (tuxedo is based in ubuntu actually in kde neon to be exactly…)

  "TUXEDO OS": "UB"

I also added "TUXEDOOS": "UB" as I saw this with redhat… neverhtless when I run sat tool it tells me that is not recognized and that i should add it.

sat/sat config SALOME-9.12.0-native --check_system
Unknown distribution: 'not found'
Please add your distribution to src/internal_config/distrib.pyconf

regards

indeed if you look at the source code sat/src/architecture.py
and search for the function get_distribution, you can read that it needs to be set in lower case.
Here you need to set:

"tuxedo os" : "UB"

can you share the output of:

cat /etc/os-release

as well as the output of:

from distro import linux_distribution
print(linux_distribution())

thanks .

can you share the output of etc/os/release:

the is no etc/os/release but I have etc/lsb-release and etc/lsb-release.dist

> cat etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="TUXEDO OS 2 22.04.4 LTS"

> cat lsb-release.dist 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.4 LTS"

and search for the function get_distribution, you can read that it needs to be set in lower case.
Here you need to set:

"tuxedo os" : "UB"

the output of print(linux_distribution()) is in my previous message

I added to $salome_path/sat/src/distrib.pyconf and runned sat command:

sat/sat config SALOME-9.12.0-native --check_system
CRITICAL :: Exception raised for execute_cli('config SALOME-9.12.0-native --check_system'):
 | 
 | Traceback (most recent call last):
 |   File "/home/franco/Downloads/SALOME-9.12.0/sat/sat", line 60, in <module>
 |     returnCode = sat.execute_cli(args)
 |   File "/home/franco/Downloads/SALOME-9.12.0/sat/src/salomeTools.py", line 286, in execute_cli
 |     code = fun_command(self.remaindersArgs[1:])
 |   File "/home/franco/Downloads/SALOME-9.12.0/sat/src/salomeTools.py", line 415, in run_command
 |     self.cfg = cfgManager.get_config(datadir=self.datadir,
 |   File "/home/franco/Downloads/SALOME-9.12.0/sat/commands/config.py", line 435, in get_config
 |     raise src.SatException(
 | 
 | src.SatException: Configuration file 'SALOME-9.12.0-native.pyconf' not found, use 'config --list' to get the list of available applications.
 | 

Are you using the universal binary ?

the output was from the universal vr as I wanted to use that one and was having issues with the explode command, for the ubuntu one (it was running but after running the sat it looks like some dependencies were missing) here is the output: and I should remark for next version of salome that there is an error in the output, if you see in the warning it says to install the dependencies and it mentions ‘fftw’ this is not recognized by apt install, and it even stoped my apt install, but if you remove that one and install all the rest and re run the sat it will be enought to have all the dependencies so, this ‘fftw’ should not be printed…


WARNING: Some run time system dependencies are missing!
Please install them with apt before running salome
missing run time dependencies : python3-babel python3-pytest-cython python3-jinja2 python3-sphinx python3-alabaster python3-certifi python3-cycler python3-dateutil python3-docutils fftw python3-imagesize python3-kiwisolver python3-markupsafe python3-matplotlib python3-mpi4py python3-nose python3-numpy python3-numpydoc python3-pandas python3-tz python3-requests libffi7 libopenblas0-serial python3-scipy python3-sip python3-stemmer python3-sphinx-rtd-theme python3-sphinxcontrib.websupport sphinx-intl python3-statsmodels python3-toml python3-urllib3 

WARNING: Some compile time system dependencies are missing!
Please install them with apt before compiling salome
missing compile time dependencies : pyqt5-dev pyqt5-dev-tools libboost-all-dev libcppunit-dev libeigen3-dev fftw-dev libgraphviz-dev llvm-dev libqwt-qt5-dev libxpm-dev libtbb-dev cython3 libopenblas-dev qttools5-dev libqt5svg5-dev libqt5x11extras5-dev qtxmlpatterns5-dev-tools libtiff5-dev dvipng python3-sip-dev python3-statsmodels 

regards,
franco

Indeed this should not be used in case of universal binary. This command is aimed for non universal distributions. This needs to be fixed.
Thanks
Regards.

1 Like