Using pip from your program: wrong command · Issue #7008 · pypa/pip (original) (raw)

In the documentation, there is a mistake in the subprocess command at the bottom of the page.

https://pip.pypa.io/en/stable/user_guide/#using-pip-from-your-program

The first command is: subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'my_package']) which works fine.

But the second is: reqs = subprocess.check_output([sys.executable, '-m', 'pip', 'freeze'])
And should be: reqs = subprocess.check_output([sys.executable, '-m', 'pip', 'install', 'freeze'])