skip to Main Content

I am trying to use the meshing software Salome with Python. As i want to use a solely automated script for meshing of a simple geometry, i need the salome API.

Salome is so far installes on a laptop with Ubuntu 22.04. and is running. However if i try to use one of the tutorial scripts in vscode i am only presented with:

ModuleNotFoundError: No module named ‘salome’

How can i resolve this?

2

Answers


  1. Chosen as BEST ANSWER

    The issue can be resolved by opening the terminal navigating to the salome directory and running the command

    source env_launch.sh
    

    immediately after that start VScode with

    code
    

    VScode now can import the salome packages and execute programms. This works for Ubuntu.


    • Select the correct interpreter (Ctrl+Shift+P –> Python: Select Interpreter)

    • Executes the code with the Python extension (Run Python File).

      enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search