Python
The macOS ships with a system Python. On older versions this is Python 2.7; on newer versions it is Python 3. We should avoid using the system Python for development work for two important reasons:
- It is managed by Apple and may be updated or removed during OS upgrades.
- Installing packages into the system Python can corrupt system tools that rely on it.
Instead, we would use pyenv to install and manage independent Python versions. Before proceeding with pyenv in next chapter, let's first check the system python.
Current State
Before proceeding, let's check the current state:
% which python3
/usr/bin/python3
% python3 --version
Python 3.8.2
System Python 3.8.2 is present. We will leave it untouched and manage all project-level Python versions through pyenv. If python3 is not found on the machine, we may optionally install it via brew install python3, though this is not required since pyenv will supply project-specific versions.
