Skip to content

Commit

Permalink
Merge pull request #7917 from deveshks/fix-docs-for-pip-usage-in-program
Browse files Browse the repository at this point in the history
Clarify use of freeze in pip in program example
  • Loading branch information
pfmoore authored Mar 28, 2020
2 parents e1e5588 + be2268e commit 4381493
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/html/user_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -814,8 +814,8 @@ This is easily done using the standard ``subprocess`` module::

subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'my_package'])

If you want to process the output further, use one of the other APIs in the
module::
If you want to process the output further, use one of the other APIs in the module.
We are using `freeze`_ here which outputs installed packages in requirements format.::

reqs = subprocess.check_output([sys.executable, '-m', 'pip', 'freeze'])

Expand All @@ -832,3 +832,5 @@ of ability. Some examples that you could consider include:

* ``distlib`` - Packaging and distribution utilities (including functions for
interacting with PyPI).

.. _freeze: https://pip.pypa.io/en/latest/reference/pip_freeze/
1 change: 1 addition & 0 deletions news/7008.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Clarify the usage of freeze command in the example of Using pip in your program

0 comments on commit 4381493

Please sign in to comment.