import sys import subprocess subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'playsound']) import playsound playsound("MyPathMySound.mp3")