subprocess – Use PyInstaller or other python commands in a python script

I would like to make a script that generates an exe file with pyinstaller from computers that do not necessarily have python installed.

For this, I did something like this:

python_script_path = input("Enter the path of the Python file. Ex : C:\User\Desktop\test.py -> ")
subprocess.run(r'python -m pyinstaller {python_script_path}')

Of course, when I execute this, I have this error “No module named pyinstaller” even if I actually have PyInstaller on my computer.

So I don’t know how to deal with it..

Thank you !