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

Add macos shebang workaround description #1204

Merged
merged 3 commits into from
Jan 13, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,18 @@ 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 under `~/Library/Application Support/pipx`.
Gitznik marked this conversation as resolved.
Show resolved Hide resolved
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.

```
ln -s $HOME/Library/Application Support/pipx $HOME/Library/ApplicationSupport/pipx
Gitznik marked this conversation as resolved.
Show resolved Hide resolved
```

## 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