python-poetry / python-poetry/install.python-poetry.org
Installation of poetry in default location for macOS not working for framework builds
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 255
- Forks
- 65
- Avg merge
- 2h 48m
- Merged PRs (30d)
- 1
Description
After poetry installation, poetry is not a recognized command.
I am running python 3.11 on macOS. I inspected the installation code and I see the following function:
def bin_dir(version: Optional[str] = None) -> Path:
if os.getenv("POETRY_HOME"):
return Path(os.getenv("POETRY_HOME"), "bin").expanduser()
user_base = site.getuserbase()
if WINDOWS:
bin_dir = os.path.join(user_base, "Scripts")
else:
bin_dir = os.path.join(user_base, "bin")
return Path(bin_dir)
It seems like site.getuserbase() resolves to ~/Library/Python/3.11. That is not part of my PATH and therefore I get poetry: command not found.
Since I am configuring poetry with github-actions, I ended up doing the following:
python -c "import os, site; print(os.path.join(site.getuserbase(), 'bin'))" >> $GITHUB_PATH
I was just wondering if site-packages is the best default location for poetry and I presented an example on how sometimes poetry is not installed by default in a location included by PATH. Usually the decision is to install it in /usr/bin or /usr/local/bin.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the installer’s bin_dir function and reproduce the Python 3.11 macOS behavior of site.getuserbase() returning ~/Library/Python/3.11. Compare the resulting bin path with PATH handling in the installation flow and the GitHub Actions workaround. Done means the default installation is either placed on PATH or the intended PATH setup is clearly defined and tested.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, macos, python
- Domain
- cli, devops, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100