EDIT: The computer in question was a client machine with restrictions on what software could be installed. I\'m unsure if that may have been a cause of the issue or if the c
For more recent versions of pip (pip>=10.0.0), the functionality described in the other answers will no longer work. I recommend running the pip with subprocess as follows:
import subprocess
import sys
my_path =
command_list = [sys.executable, "-m", "pip", "install", my_path]
with subprocess.Popen(command_list, stdout=subprocess.PIPE) as proc:
print(proc.stdout.read())
This solution uses the current python executable to run the pip command as a commandline command. It was inspired by the solution mentioned here.