Skip to content

Commit

Permalink
Merge branch 'python_option' of https:/pfmoore/pip into p…
Browse files Browse the repository at this point in the history
…ython_option
  • Loading branch information
pfmoore committed Jul 31, 2022
2 parents b6be01a + d0b5a8f commit ddfa05c
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions docs/html/topics/python-option.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Managing a different Python interpreter

```{versionadded} 22.3
```

Occasionally, you may want to use pip to manage a Python installation other than
the one pip is installed into. In this case, you can use the `--python` option
Expand All @@ -16,22 +18,12 @@ environment.
One example of where this might be useful is to manage a virtual environment
that does not have pip installed.

````{tab} Unix/macOS
```{code-block} console
```{pip-cli}
$ python -m venv .venv --without-pip
$ python -m pip --python .venv install SomePackage
[...]
Successfully installed SomePackage
```
````
````{tab} Windows
```{code-block} console
C:\> py -m venv .venv --without-pip
C:\> py -m pip --python .venv install SomePackage
$ pip --python .venv install SomePackage
[...]
Successfully installed SomePackage
```
````

You could also use `--python .venv/bin/python` (or on Windows,
`--python .venv\Scripts\python.exe`) if you wanted to be explicit, but the
Expand Down

0 comments on commit ddfa05c

Please sign in to comment.