Library not loaded: @rpath/Python3.framework/Versions/3.9/Python3

Hi, I try to install paraview (tag: v5.12.0-RC3) on Mac.
The code is ok to build, but I got this error when I execute the executable file:

$ ./bin/paraview.app/Contents/MacOS/paraview 
dyld[25562]: Library not loaded: @rpath/Python3.framework/Versions/3.9/Python3
  Referenced from: <D4B73448-3BB4-394D-BB95-57534A33E26A> /Users/zw1/Documents/cworkspace/build/paraview/bin/paraview.app/Contents/MacOS/paraview
  Reason: tried: '/Users/zw1/Documents/cworkspace/build/paraview/lib/Python3.framework/Versions/3.9/Python3' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/zw1/Documents/cworkspace/build/paraview/lib/Python3.framework/Versions/3.9/Python3' (no such file), '/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/Python3.framework/Versions/3.9/Python3' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/Python3.framework/Versions/3.9/Python3' (no such file), '/Users/zw1/Documents/cworkspace/build/paraview/lib/Python3.framework/Versions/3.9/Python3' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/zw1/Documents/cworkspace/build/paraview/lib/Python3.framework/Versions/3.9/Python3' (no such file), '/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/Python3.framework/Versions/3.9/Python3' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/Python3.framework/Versions/3.9/Python3' (no such file)
Abort trap: 6

This is the path of my python3

zw1@MAC132276 3.9$ ls
Headers        Python3        Resources      _CodeSignature bin            include        lib            share
zw1@MAC132276 3.9$ pwd
/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9

This is the command to build the paraview

cmake -GNinja -DPARAVIEW_USE_PYTHON=ON -DPARAVIEW_USE_MPI=ON -DVTK_SMP_IMPLEMENTATION_TYPE=OPENMP -DCMAKE_BUILD_TYPE=Release ../../src/paraview

It seems that the paraview could not find the right path of the python3 during the build process, could you provide some help about it?

Thanks!

I found that the rpath of the executable is

/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib

It can work if I reset it to

-Wl,-rpath,/Applications/Xcode.app/Contents/Developer/Library/Frameworks

when compiling the executable file.

Yes, rpath management is a distributor/packager thing. We cannot possibly know all possible end-user layouts to set up rpaths properly without external input.