Managing Python installations¶
macOS¶
-
Verify and install the latest supported Python version from python.org
🚨 Do not use the one from Homebrew as it is known to cause issues
-
Ensure the
~/.zprofileof all accounts contains the following lines, and remove any older ones, if they exist:(make sure to replace
<version>with the version of the newly installed Python, e.g.,3.13)🚨 When a user installs Python from python.org, it is installed by default in a non-standard location (
/Library/Frameworks/Python.framework/Versions/), and can co-exist with previous installations from https://python.org. In order to make it accessible to the shell, the Python installer updates thePATHenvironment variable. However, it does so only for the account that installs Python, and not for the rest of the accounts. So, the last part must be done manually. -
Exit any previous terminal/SSH sessions, so that the
$PATHchanges can take effect.(We can't just
source ~/.zshrc, because it doesn't account for removals or changes in~/.zprofile) -
Ensure
which python3returns the expected Python installation -
Install Poetry from an account with admin privileges, with
python3 -m pip install -U poetry -
Ensure
which poetryreturns the expected Poetry installation -
Ensure that Poetry picks the correct Python version with
poetry debug info
Windows¶
-
Verify and install the latest supported Python version from python.org
-
Install Poetry with
python -m pip install -U poetry -
Ensure that Poetry picks the correct Python version with
poetry debug info