Hi,
To build the pytorch with specific python version.
Please refer to below topics build from source section
build from source
Thanks