Replies: 4 comments 7 replies
-
I have never had a problem with a space in my home directory on windows with powershell. Is there a way to mute the warning? |
Beta Was this translation helpful? Give feedback.
-
Your MacOS instructions fail because of spaces in the variables. You need to add double quotes to the instructions at the bottom: cache_dir=$(pipx environment --value PIPX_VENV_CACHEDIR)
logs_dir=$(pipx environment --value PIPX_LOG_DIR)
trash_dir=$(pipx environment --value PIPX_TRASH_DIR)
home_dir=$(pipx environment --value PIPX_HOME)
rm -rf "$cache_dir" "$logs_dir" "$trash_dir"
mkdir -p ~/.local && mv "$home_dir" ~/.local
pipx reinstall-all |
Beta Was this translation helpful? Give feedback.
-
The edge case I have run into is when the username has a space (Windows), which is due to our company IT configuration. In these cases the suggested commands would still produce issues. For Windows I ran the Example: setx PIPX_HOME "V:\packages\pipx"
setx PIPX_BIN_DIR "V:\packages\.local\bin"
setx PIPX_MAN_DIR "V:\packages\.local\share\man"
setx PIPX_SHARED_LIBS "V:\packages\pipx\shared"
setx PIPX_LOCAL_VENVS "V:\packages\pipx\venvs"
setx PIPX_LOG_DIR "V:\packages\pipx\logs"
setx PIPX_TRASH_DIR "V:\packages\pipx\trash"
setx PIPX_VENV_CACHEDIR "V:\packages\pipx\.cache"
setx PIPX_STANDALONE_PYTHON_CACHEDIR "V:\packages\pipx\py" If desired a symlink could also be created to the original home directory location. Or the
|
Beta Was this translation helpful? Give feedback.
-
This is now part of our official documentation, hence I'm closing this discussion. For any other problems regarding this, please refer to the |
Beta Was this translation helpful? Give feedback.
-
Intro
In pipx version 1.5, we introduced the warning you're seeing, as multiple incompatibilites with spaces in the pipx home path were discovered. You may see this for the following reasons:
Why are you seeing this error
PIPX_HOME
to a path with spaces in it explicitlyWhy are spaces in the
PIPX_HOME
path badThe main reason we can't support paths with spaces is that shebangs don't support spaces in the interpreter path. All applications installed via
pipx
are installed viapip
, which creates a script with a shebang at the top, defining the interpreter of thevenv
to use.pip
does some magic to the shebang for scripts defined as ascript
, that resolves this issue. Unfortunately, many libraries define their scripts asconsole_scripts
, wherepip
does not perform this logic. Therefore, these scripts cannot be run if installed withpipx
in a path with spaces, as the path to thevenv
and therefore the interpreter to use will contain spaces.If you want to use a script installed via pipx in a shebang itself (common for example for the aws cli), you run into a similar problem, as the path to the installed script will contain a space.
See these issues for more details on the described problems: #1198, #1212
How to fix
You can generally fix this by using our default locations.
If you're really sure you want to stick to your path with spaces, you can run all
pipx
command with the-q
flag, ignoring warnings.Warning
While the following scripts have been tested and should work reliably, please save the result of
pipx list --json
before running them, so worst case at least you have all the information you need to replicate your old installs.MacOS
Linux
Windows
Requires bash (for example
git bash
)Warning
This has not been tested by a maintainer. Please let us know if this works for you.
Beta Was this translation helpful? Give feedback.
All reactions