Getting Python on Your Machine (Without Losing Your Mind)
Choosing Your Python: CPython or Anaconda?
CPython is the reference Python you find at python.org. It stays light and works with pip, the default package manager.
Anaconda comes as a bundled distribution aimed at data science. It ships with many scientific libraries and its own Conda manager, which also handles non-Python dependencies.
Pick CPython if you want tight control or focus on web work. Choose Anaconda when your priority is data projects and you prefer quick, hassle-free setup.
Installing Python Step by Step
Windows
Download CPython from python.org or Anaconda from anaconda.com. During CPython setup, check Add Python to PATH. After installation, open Command Prompt and run python --version to confirm success.
macOS
Use the official installer or Homebrew (brew install python) for CPython. For Anaconda, grab the .pkg file. Verify with python3 --version, because macOS still includes an outdated Python 2.
Linux
Most distributions preinstall Python 3, but it may be old. Update with your package manager (sudo apt install python3). To install Anaconda, download the shell script and run it, then check with python3 --version.
Pitfalls
Double installations or PATH mix-ups cause most errors. If Python won’t start, reboot first, then search “add Python to PATH [your OS]” or reinstall with admin rights.
Managing Multiple Python Versions with pyenv
pyenv lets you keep several Python versions side by side. Install it through Homebrew on macOS or the instructions at github.com/pyenv/pyenv for Linux.
Run pyenv install 3.11.4, then pyenv global 3.11.4 to set a default. Switch anytime with pyenv global 3.9.13.
Inside a project folder, pyenv local 3.8.10 locks that version for just that directory. Windows users can try pyenv-win or rely on the built-in py launcher.
pip vs. Conda: What’s the Difference?
What pip Does Best
pip connects to PyPI and installs pure Python packages quickly. Use it for libraries like pandas, Django, or hobby tools. It assumes system libraries already exist, so compilation errors can appear when they don’t.
What Conda Does Best
Conda installs both Python libraries and their non-Python dependencies. This reduces setup errors for heavy data packages like NumPy. Use conda install numpy to fetch everything in one step.
When to Use Each
On Anaconda, prefer Conda packages first and use pip only as a fallback. On CPython, stick with pip and well-documented libraries. Mixing managers can break environments, so change one thing at a time and rebuild if problems arise.