import os import sys path = '"'+os.path.dirname(sys.executable)+'\scripts\pip" install --upgrade pip' os.system(path)