Skip to content

Commit

Permalink
doc: Allow setting custom venv path
Browse files Browse the repository at this point in the history
Close #2096

Signed-off-by: Frost Ming <[email protected]>
  • Loading branch information
frostming committed Jul 11, 2023
1 parent 66068b2 commit d714d60
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/docs/usage/venv.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ $ pdm venv create --with venv 3.9
For the first time, PDM will try to create a virtualenv **in project**, unless `.venv` already exists.
Other virtualenvs go to the location specified by the `venv.location` configuration. They are named as `<project_name>-<path_hash>-<name_or_python_version>` to avoid name collision. A virtualenv created with `--name` option will always go to this location. You can disable the in-project virtualenv creation by `pdm config venv.in_project false`.

## Reuse the virtualenv you created elsewhere

You can tell PDM to use a virtualenv you created in preceding steps, with [`pdm use`](../reference/cli.md#use):

```bash
pdm use -f /path/to/venv
```

## Virtualenv auto-detection

When no interpreter is stored in the project config or `PDM_IGNORE_SAVED_PYTHON` env var is set, PDM will try to detect possible virtualenvs to use:
Expand Down
1 change: 1 addition & 0 deletions news/2096.doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add notes about using custom venv path.

0 comments on commit d714d60

Please sign in to comment.