Personal tools
You are here: Home Forum Install & build problem with salome 9.7 ubuntu vr in windows WSL with ubuntu 20.04

problem with salome 9.7 ubuntu vr in windows WSL with ubuntu 20.04

Up to Install & build


This forum is DEPRECATED, please create new topics in the new SALOME forum.
For existing topics please transfer them to the new forum.

problem with salome 9.7 ubuntu vr in windows WSL with ubuntu 20.04

Posted by franco.ota at July 06. 2021

hello,

I just downloaded the last vr of salome for ubuntu and as in a ubuntu machine, i extracted with tar but when I run salome,

get the following error:

"

ERROR:salomeContext:Unexpected error:

Traceback (most recent call last):

  File "/home/otaolafr/SALOME-9.7.0-native-UB20.04-SRC/BINARIES-UB20.04/SALOME/bin/salome/salomeContext.py", line 278, in _startSalome

    res = getattr(self, command)(options) # run appropriate method

  File "/home/otaolafr/SALOME-9.7.0-native-UB20.04-SRC/BINARIES-UB20.04/SALOME/bin/salome/salomeContext.py", line 353, in _runAppli

    import setenv

  File "/home/otaolafr/SALOME-9.7.0-native-UB20.04-SRC/BINARIES-UB20.04/KERNEL/bin/salome/setenv.py", line 26, in <module>

    import orbmodule

  File "/home/otaolafr/SALOME-9.7.0-native-UB20.04-SRC/BINARIES-UB20.04/KERNEL/bin/salome/orbmodule.py", line 30, in <module>

    from nameserver import NamingServer

  File "/home/otaolafr/SALOME-9.7.0-native-UB20.04-SRC/BINARIES-UB20.04/KERNEL/bin/salome/nameserver.py", line 26, in <module>

    from server import Server

  File "/home/otaolafr/SALOME-9.7.0-native-UB20.04-SRC/BINARIES-UB20.04/KERNEL/bin/salome/server.py", line 25, in <module>

    from salome_utils import getHostName

  File "/home/otaolafr/SALOME-9.7.0-native-UB20.04-SRC/BINARIES-UB20.04/KERNEL/bin/salome/salome_utils.py", line 39, in <module>

    import psutil

ModuleNotFoundError: No module named 'psutil'

 

"

PS. I know that there is a windows 10 native version, but I could not succesuflly run .py scripts from the terminal with this version. thats why I was looking to install the ubuntu vr inside wsl

best regards

Re: problem with salome 9.7 ubuntu vr in windows WSL with ubuntu 20.04

Posted by franco.ota at July 06. 2021

Quick update, I solve this issue (not sure if it works! but at least I do not get the error) by:

copying "\home\otaolafr\SALOME-9.7.0-native-UB20.04-SRC\PROJECT\products\env_scripts\psutil.py"

to "\home\otaolafr\SALOME-9.7.0-native-UB20.04-SRC\BINARIES-UB20.04\KERNEL\bin\salome"

 

still I am getting an error from "/home/otaolafr/SALOME-9.7.0-native-UB20.04-SRC/salome -t -u preparingGeom.py" but clearly from the error it looks that salome is workign....
that says

usage: salome start [options] [STUDY_FILE] [PYTHON_FILE [args] [PYTHON_FILE [args]...]]

Python file arguments, if any, must be comma-separated (without blank characters) and prefixed by "args:" (without quotes), e.g. myscript.py args:arg1,arg2=val,...

runSalome: error: unrecognized arguments: -u

ERROR:salomeContext:SystemExit 2 in method _runAppli.

Re: problem with salome 9.7 ubuntu vr in windows WSL with ubuntu 20.04

Posted by franco.ota at July 06. 2021

looks like -u was an old argument but still getting errors with -t argument only.

 

runSalome running on DESKTOP-DUTB7J5-otaolafr

Process Process-1:

Traceback (most recent call last):

  File "/usr/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap

    self.run()

  File "/usr/lib/python3.8/multiprocessing/process.py", line 108, in run

    self._target(*self._args, **self._kwargs)

  File "/home/otaolafr/SALOME-9.7.0-native-UB20.04-SRC/BINARIES-UB20.04/KERNEL/bin/salome/searchFreePort.py", line 68, in searchFreePort_withPortManager

    port = getPort(use_port)

  File "/home/otaolafr/SALOME-9.7.0-native-UB20.04-SRC/BINARIES-UB20.04/KERNEL/bin/salome/PortManager.py", line 144, in getPort

    while __isPortUsed(port, config):

  File "/home/otaolafr/SALOME-9.7.0-native-UB20.04-SRC/BINARIES-UB20.04/KERNEL/bin/salome/PortManager.py", line 105, in __isPortUsed

    return (port in busy_ports) or __isNetworkConnectionActiveOnPort(port)

  File "/home/otaolafr/SALOME-9.7.0-native-UB20.04-SRC/BINARIES-UB20.04/KERNEL/bin/salome/PortManager.py", line 110, in __isNetworkConnectionActiveOnPort

    return port in [c.laddr.port for c in psutil.net_connections(kind='inet') if \

AttributeError: module 'psutil' has no attribute 'net_connections'

"

best regards

Re: problem with salome 9.7 ubuntu vr in windows WSL with ubuntu 20.04

Posted by ghodbane at July 06. 2021

Hi Franco,

quoting:

". I know that there is a windows 10 native version, but I could not succesuflly run .py scripts from the terminal with this version. thats why I was looking to install the ubuntu vr inside wsl"

can you elaborate about the issue you're experiencing with running python script from terminal ?

 

Then, you should NOT copy psutils.py from PROJECT, since this file is aimed at compile time only of SALOME application. Instead, you need to ensure that python3-psutil is installed

Note, that you can check all missing packages as written in the README, with command:

                           ./sat config SALOME-9.7.0-native --check_system

 

Can you please tell which issue you're experiencing with Windows, to check if we can help here ?

 

 

Re: problem with salome 9.7 ubuntu vr in windows WSL with ubuntu 20.04

Posted by franco.ota at July 06. 2021

Hello nabil,

thanks for the help

I excuse myself if I am missing something.

I was trying to run a python dump script with the windows vr of salome, from the WSL terminal.
I usually do this with scripts from paraview (using also the windows version)

I was using the command "/mnt/c/SALOME-9.7.0/run_salome.exe -t test9_7.py" but this opens the python3 windows, and then nothing happens. I was looking to run the code in the background,

if I open salome with the GUI, and go ->load script and choose the test9_7.py it runs correctly.

best regards

 

Previously Nabil Ghodbane wrote:

Hi Franco,

quoting:

". I know that there is a windows 10 native version, but I could not succesuflly run .py scripts from the terminal with this version. thats why I was looking to install the ubuntu vr inside wsl"

can you elaborate about the issue you're experiencing with running python script from terminal ?

 

Then, you should NOT copy psutils.py from PROJECT, since this file is aimed at compile time only of SALOME application. Instead, you need to ensure that python3-psutil is installed

Note, that you can check all missing packages as written in the README, with command:

                           ./sat config SALOME-9.7.0-native --check_system

 

Can you please tell which issue you're experiencing with Windows, to check if we can help here ?

 

 

 

Re: problem with salome 9.7 ubuntu vr in windows WSL with ubuntu 20.04

Posted by ghodbane at July 06. 2021

It seems that there is an issue with run_salome.exe and how it is handling extra arguments. Indeed it is aimed to be a simple SALOME launcher.

Thanks for reporting about the issue.

You can instead use the run_salome.bat, which handles consistently the number of arguments.

call run_salome.bat -t test9_7.py

 

Re: problem with salome 9.7 ubuntu vr in windows WSL with ubuntu 20.04

Posted by franco.ota at July 06. 2021

Hello nabil,

with pleasure! I am not really a lot of helpfull but at least if I can help with anything I am happy.

in any case, run_salome.bat does not work either.

when I run "/mnt/c/SALOME-9.7.0/run_salome.bat -t test9_7.py"

I get:

"

/mnt/c/SALOME-9.7.0/run_salome.bat: line 1: @ECHO: command not found

/mnt/c/SALOME-9.7.0/run_salome.bat: line 2: $'\r': command not found

/mnt/c/SALOME-9.7.0/run_salome.bat: line 3: REM: command not found

/mnt/c/SALOME-9.7.0/run_salome.bat: line 4: REM: command not found

/mnt/c/SALOME-9.7.0/run_salome.bat: line 5: REM: command not found

/mnt/c/SALOME-9.7.0/run_salome.bat: line 6: REM: command not found

/mnt/c/SALOME-9.7.0/run_salome.bat: line 7: REM: command not found

/mnt/c/SALOME-9.7.0/run_salome.bat: line 8: SALOME: No such file or directory

/mnt/c/SALOME-9.7.0/run_salome.bat: line 9: SALOME: No such file or directory

/mnt/c/SALOME-9.7.0/run_salome.bat: line 10: $'REM\r': command not found

/mnt/c/SALOME-9.7.0/run_salome.bat: line 11: $'\r': command not found

/mnt/c/SALOME-9.7.0/run_salome.bat: line 12: SET: command not found

/mnt/c/SALOME-9.7.0/run_salome.bat: line 13: REM: command not found

/mnt/c/SALOME-9.7.0/run_salome.bat: line 14: SET: command not found

/mnt/c/SALOME-9.7.0/run_salome.bat: line 15: syntax error near unexpected token `('

'mnt/c/SALOME-9.7.0/run_salome.bat: line 15: `IF EXIST "%SALOME_GUI_ROOT_DIR%\opengl32.dll" (

"

 

 

 

Previously Nabil Ghodbane wrote:

It seems that there is an issue with run_salome.exe and how it is handling extra arguments. Indeed it is aimed to be a simple SALOME launcher.

Thanks for reporting about the issue.

You can instead use the run_salome.bat, which handles consistently the number of arguments.

call run_salome.bat -t test9_7.py

 

 

Re: problem with salome 9.7 ubuntu vr in windows WSL with ubuntu 20.04

Posted by ghodbane at July 06. 2021

Hi Franco,

you need to run run_salome.bat FROM a CMD terminal IN WINDOWS.

so open a cmd terminal, then cd to your SALOME installation folder with cd C:\SALOME-9.7.0

then run: call run_salome.bat <and your options>

HTH

Re: problem with salome 9.7 ubuntu vr in windows WSL with ubuntu 20.04

Posted by franco.ota at July 07. 2021

hello nabil,

thanks for you useful help and recommendations!

now everything is working, 

for anyone that comes across this post might be helpful:

As I needed to run the salome script inside a bash file (and running it from the terminal in ubuntu WSL), I used the following command:

" cmd.exe /mnt/c/SALOME-9.7.0/run_salome.bat -t ./scriptPythonSalome.py "

also as a side note, to wait until the script finish,

I added the creation of a dummy file in the scriptPythonSalome.py and in the bash script a while loop that checks until it finds the dummy file.
also the python consol does not close once the script is finished, for this I added to the python script at the end:

import killSalome

 

killSalome.killAllPorts()

best regards.

F.


This forum is DEPRECATED, please create new topics in the new SALOME forum.
For existing topics please transfer them to the new forum.

Powered by Ploneboard
Document Actions