Skip to content

Why should I avoid using the system Python?

The “system Python” refers to the Python interpreter that comes pre-installed with your operating system. On macOS and Linux systems, this is typically found at /usr/bin/python3. On Windows, it may be the Python installation available through the Microsoft Store or a manual system-wide installation.

Using the system Python directly for development work creates several risks:

  • Operating System Dependencies: Your operating system relies on the system Python interpreter to run essential system tools and utilities. Modifying packages in the system Python environment (upgrading or removing packages) can break system functionality.
  • Permission Issues: Installing packages into the system Python requires administrator/root privileges. This creates security risks and inconvenience, forcing you to use sudo or run as administrator to manage packages.
  • Version Conflicts: Different projects require different versions of Python or packages. System Python locks you into a single version that may not suit all your work. System-provided Python versions often lag behind the latest releases.
  • Reproducibility Problems: Sharing code or deploying to different environments becomes difficult with system Python. The system Python version and pre-installed packages vary significantly across different operating systems and versions.

Best Practices

Instead of using the system Python:

  • Use tools like uv or pyenv to manage multiple Python versions
  • Create isolated virtual environments for each project
  • Explicitly specify Python version requirements in your project configuration
  • Document dependencies using pyproject.toml

This approach provides better isolation, reproducibility, and version control while protecting your system’s stability.

Even if you install Python manually on your system, it’s still recommended to use virtual environments and proper dependency management tools to isolate your project dependencies.
Last updated on

Please submit corrections and feedback...