Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PIPX_HOME move instruction and improve text #1063

Merged
merged 2 commits into from
Nov 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
```
Loading