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

Installation of poetry in default location for macOS not working for framework builds #110

Open
codectl opened this issue Mar 14, 2023 · 0 comments

Comments

@codectl
Copy link

codectl commented Mar 14, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant