Skip to content

Commit

Permalink
Fix PIPX_HOME move instruction and improve text (#1063)
Browse files Browse the repository at this point in the history
* Fix PIPX_HOME move instruction and improve text

* Adopt chrysle suggested word changes
  • Loading branch information
bulletmark authored Nov 30, 2023
1 parent ef9434f commit 18d6722
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,23 @@ rm -rf test_venv

## Pipx files not in expected locations according to documentation

The default PIPX_HOME is `~/.local/pipx`, prior to the adoption of the XDG base
directory specification after version 1.2.0. To maintain compatibility with older
versions, pipx will automatically detect the old paths and use them accordingly.
For a map of old and new paths, See [Installation](installation.md#installation-options)

To migrate from the old path to the new path, you can remove the `~/.local/pipx` directory and
reinstall all packages.

For example, on Linux systems, you could read out `pipx`'s package information in JSON via `jq` (which you might need to install first):

```
packages=($(pipx list --json | jq '.venvs | keys[]' -r))
rm -rf ~/.local/pipx
for p in ${packages[@]}; do pipx install "$p"; done
Pipx versions after 1.2.0 adopt the XDG base directory specification for
the location of `PIPX_HOME` and the data, cache, and log directories.
Version 1.2.0 and earlier use `~/.local/pipx` as the default `PIPX_HOME`
and install the data, cache, and log directories under it. To maintain
compatibility with older versions, pipx will automatically use this old
`PIPX_HOME` path if it exists. For a map of old and new paths, see
[Installation](installation.md#installation-options).

If you have a `pipx` version later than 1.2.0 and want to migrate from
the old path to the new paths, you can move the `~/.local/pipx`
directory to the new location (after removing cache, log, and trash
directories which will get recreated automatically) and then reinstall
all packages. For example, on Linux systems, `PIPX_HOME` moves from
`~/.local/pipx` to `~/.local/share/pipx` so you can do this:

```
rm -rf ~/.local/pipx/{.cache,logs,trash}
mkdir -p ~/.local/share && mv ~/.local/pipx ~/.local/share/
pipx reinstall-all
```

0 comments on commit 18d6722

Please sign in to comment.