Skip to content

Fix installation failure when Python is from macOS Command Line Tools - #187

Draft
caorantaoyao wants to merge 2 commits into
python-poetry:mainfrom
caorantaoyao:fix/issue-24-7e68be
Draft

Fix installation failure when Python is from macOS Command Line Tools#187
caorantaoyao wants to merge 2 commits into
python-poetry:mainfrom
caorantaoyao:fix/issue-24-7e68be

Conversation

@caorantaoyao

Copy link
Copy Markdown

When python3 is provided by the macOS Xcode Command Line Tools (e.g. /usr/bin/python3 -> /Library/Developer/CommandLineTools/usr/bin/python3), the cpython venv it creates carries an unresolvable @executable_path/../Python3 loader reference in bin/python, so pip fails with a dyld error and the poetry install aborts.

This change makes VirtualEnvironment.make() detect that situation (sys.platform == "darwin" and /Library/Developer/CommandLineTools in sys.executable) and route through the existing robust virtualenv.pyz bootstrap (--clear --always-copy) instead of the broken cpython venv path. The branch is additive and guarded to darwin + CommandLineTools only; the normal cpython venv path is unchanged.

A new test (tests/test_installer.py) mocks the darwin/CLT interpreter and asserts the --always-copy bootstrap is used.

@vercel

vercel Bot commented Aug 10, 2026

Copy link
Copy Markdown

@caorantaoyao is attempting to deploy a commit to the Poetry Team on Vercel.

A member of the Team first needs to authorize it.

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

Successfully merging this pull request may close these issues.

1 participant