Thank you for your advice.
I tried your advice, and it didn't seems to help (assuming it was done correctly).
I also tried running "external" python3.9
with the environment from Slicer, and it worked.
I also tried running with the bin/PythonSlicer
executable (that uses the slicer environment), and it worked.
I tried running the code in a different process (using multiprocessing) but it looks like slicer does not work with multiprocessing.
Thanks