Skip to content

Poetry environment breaks when Homebrew upgrades Python on MacOS #71

Open
@keithvsr

Description

@keithvsr

Issue experienced in Poetry 1.2.1
Python version 3.10.6_2 -> 3.10.7 and 3.10.7 -> 3.10.8 upgrades
OS version MacOS 12.6
(not project-specific so no pyproject.toml)

Issue

Poetry commands cease working and throw errors after upgrading the installed Python version using Homebrew. This has occurred the last two times (3.10.6_2 upgrade to 3.10.7 and 3.10.7 upgrade to 3.10.8) using brew upgrade which included the two Python updates. Afterward, attempting to use any Poetry command fails with error output similar to the following:

poetry --version
dyld[42062]: Library not loaded: '/usr/local/Cellar/python@3.10/3.10.7/Frameworks/Python.framework/Versions/3.10/Python'
  Referenced from: '/Users/keith/Library/Application Support/pypoetry/venv/bin/python'
  Reason: tried: '/usr/local/Cellar/python@3.10/3.10.7/Frameworks/Python.framework/Versions/3.10/Python' (no such file), '/Library/Frameworks/Python.framework/Versions/3.10/Python' (no such file), '/System/Library/Frameworks/Python.framework/Versions/3.10/Python' (no such file)
zsh: abort      poetry --version

In both cases, the only Python installations available are system packages (if these even still exist) or those installed by Homebrew. Poetry has only been installed via the recommended curl -sSL https://install.python-poetry.org | python3 - command. The only way I've found to restore Poetry functionality after brew upgrade is to uninstall via the same recommended script i.e. curl -sSL https://install.python-poetry.org | python3 - --uninstall and then to reinstall Poetry

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions