Salome API in Python

Hey, i want to use the Salome API in Python to automatically generate my meshes.
However after installing Salome 9.9.0 on my System (Ubuntu 22.04.02), vscode is not able to import the API and after trying the sample code from the salome online documentation i am only greeted with:

ModuleNotFoundError: No module named ‘salome’

How can i resolve this? Thanks in advance!

Here you need to setup SALOME environment by typing: source env_launch.sh.
Note that vscode with SALOME environment can be launcher by clicking in the main toolbar on: Tools - Plugins - Launch VS code

Hi, i have tried the command source env_launch.sh in the vscode terminal. But even after that the code does still throw the error that salome can’t be imported.
This is the feedback:

nico@NicosLenovo:~$ /usr/bin/python3 /home/nico/Salome/hi.py
sh: 1: source: not found
Traceback (most recent call last):
  File "/home/nico/Salome/hi.py", line 10, in <module>
    import salome
ModuleNotFoundError: No module named 'salome'

And the terminal prints following:

nico@NicosLenovo:~/Salome$ /usr/bin/python3 /home/nico/Salome/hi.py
sh: 1: source: not found
Warning, no type found for resource "localhost", using default value "single_machine"

hello @NabilG ,
maybe I was expecting a different behavior, but If I lunch vs code from salome as you mentioned in your message, the python code opened in vs code, I don’t get the ‘suggestions’ to use functions like type geompy. and vs code does not suggest any function. nor if for example I write geompy.add it does not suggest .addToStudy.
I am missing something?
best regards