pipx exits with code 1 when called from Git Bash for Windows
See original GitHub issueDescribe the bug
Get exit code 1 when I run the pipx
command on Git Bash for Windows.
$ which -a pipx
/c/Users/thecesrom/AppData/Roaming/Python/Python310/Scripts/pipx
/c/users/thecesrom/appdata/roaming/python/python310/scripts/pipx
$ pipx
$ echo $?
1
$ cat ~/.local/pipx/logs/cmd_2022-03-04_15.56.56.log
394.8ms (setup:727): 2022-03-04 15:56:56
394.8ms (setup:728): C:\Users\thecesrom\AppData\Roaming\Python\Python310\site-packages\pipx\__main__.py
394.8ms (setup:729): pipx version is 1.0.0
394.8ms (setup:730): Default python interpreter is 'C:\\Python\\Python310\\python.exe'
400.8ms (cli:790): pipx finished.
The only way I can get pipx
to run is by using python -m pipx
.
$ python -m pipx --version
1.0.0
$ python -m pipx ensurepath
C:\Users\thecesrom\.local\bin is already in PATH.
C:\Users\thecesrom\AppData\Roaming\Python\Python310\Scripts is already in PATH.
All pipx binary directories have been added to PATH. If you are sure you want
to proceed, try again with the '--force' flag.
Otherwise pipx is ready to go!
Or by creating an alias (alias pipx="python -m pipx"
).
$ alias pipx="python -m pipx"
$ pipx --version
1.0.0
I have tried with a clean .bashrc
file, but it still fails.
How to reproduce
Pre-requisites
- Windows
- Git for Windows
- Python
pipx
- Open Git Bash
- Run
pipx
Expected behavior
pipx
should run without errors just like it does on all other shells. pipx
does run in PowerShell, and Command Prompt without issues.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Pipenv script won't run on Windows using Git Bash
SOLUTION 1: I was calling Poetry to try and make sense of it as well and then I tried calling both applications from...
Read more >pipenv Documentation - Read the Docs
The command will perform a verification, and return an exit code 1 when dependency locking is needed. This may be useful for cases...
Read more >Add executable to Ubuntu-latest PATH using GitHub workflow
/home/runner/work/_temp/long-alpha-numeric-string.sh: line 1: myapp: command not found Error: Process completed with exit code 127. This error ...
Read more >Git hook failure "Executable poetry not found" when commiting ...
I have poetry installed using pipx and the executable is located in ~/.local/bin/ . This directory is added to my path in my...
Read more >Error: Command '['/path/to/env/bin/python3.7', '-Im', 'ensurepip ...
7', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1. python3 -m venv env0 worked fine before. Why does this ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was having all the problems with pip 22.0.3. I just checked and pip22.0.4 downgraded distlib to 0.3.3 which undos the distlib change that broke the wrappers generated on Windows.
Just as an experiment I uninstalled
pipx
, and reinstalled from scratch. This meant removing all thepipx
directory from~/.local/pipx
, and my issue cleared on its own; nowpipx
runs as an executable on Git Bash.Clean install
Click to expand
pipx
-installed packagesClick to expand
So only
pipx
is installed globally, and these are the packages I install usingpipx
:Packages:
And all packages seem to be working fine. So a clean install fixed it for me using
pip 22.0.4
,Conclusion
So the first time I installed
pipx
was when Python 3.10.2 was released (2022-01-14) which came withpip 21.2.4
according to the Release Notes, and bpo-45343.And then I reinstalled
pipx
without cleaning the~/.local/pipx
directory, if it even matters.So I’m guessing that it is not entirely a
pip
-related issue, since I am using the latest version (22.0.4
), andpipx
and allpipx
-installed packages seem to be working fine after a clean installation.Maybe this could shed some light.
Thanks!