Skip to content

Commit

Permalink
Add macos shebang workaround description (#1204)
Browse files Browse the repository at this point in the history
* Add macos shebang workaround description

* Apply suggestions from code review

Co-authored-by: chrysle <fritzihab@posteo.de>
Co-authored-by: Jason Lam <meowmeowcat1211@gmail.com>

---------

Co-authored-by: Bernát Gábor <bgabor8@bloomberg.net>
Co-authored-by: chrysle <fritzihab@posteo.de>
Co-authored-by: Jason Lam <meowmeowcat1211@gmail.com>
  • Loading branch information
4 people committed Jan 13, 2024
1 parent 0c4fd1b commit 4dd1b6b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,7 @@
## dev

- [docs] Add workaround for using pipx applications in shebang under macOS

## 1.4.2

- Allow skipping maintenance tasks during list command
Expand Down
13 changes: 13 additions & 0 deletions docs/troubleshooting.md
Expand Up @@ -94,6 +94,19 @@ sudo apt install python3-venv python3-pip
Reference:
[Python Packaging User Guide: Installing pip/setuptools/wheel with Linux Package Managers](https://packaging.python.org/guides/installing-using-linux-tools)

## macOS issues

If you want to use a Pipx-installed package in a shebang (a common example is the AWS CLI),
you will likely not be able to, because the binary will be stored under `~/Library/Application Support/pipx/`.
The space in the path is not supported in a shebang. A simple solution is symlinking
`~/Library/Application Support/pipx` to `~/Library/ApplicationSupport/pipx`, and using that as the
path in the shebang instead.

```
mkdir $HOME/Library/ApplicationSupport
ln -s $HOME/Library/Application\ Support/pipx $HOME/Library/ApplicationSupport/pipx
```

## Does it work to install your package with `pip`?

This is a tip for advanced users. An easy way to check if pipx is the problem or a package you're trying to install is
Expand Down

0 comments on commit 4dd1b6b

Please sign in to comment.