Running through the subprocess doc, I found the correct answer :
import subprocess,sys
subprocess.run([sys.executable, '-m', 'pip', 'install', package],stderr=subprocess.STDOUT,stdout=subprocess.PIPE,check=True)
Moreover, as a bonus, what was print on stdout and stderr is displayed.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…