Item 1: Know which version of Python you’re using

Notes

  • Python has several different versions all in various states of maintenance

  • Python 2 is the previous major version

    • No longer supported
  • Many Operating Systems have multiple python versions installed by default

  • However the default meaning of python (the command to run python) is ill-defined

    • Typically an alias for python 2.7
      • May be an older version of python 2 though
      • Or even python 3
    • On systems where python 2 is not installed, then the command may error
      • This happens on my machine
      $ python --version
      Command 'python' not found, did you mean:
          command 'python3' from deb python3
          command 'python' from deb python-is-python3
  • Python 3, the new and currently developed major version is usually found under the command python3

  • On my machine

      $ python3 --version
      Python 3.12.3
  • Alternative run times like PyPy have their own run commands

  • I use uv which is a python version manager

    • To run a uv managed python version my command is

        uv run [python3.X]
  • You can inspect the python version at run time using the sys module

import sys

print(sys.platform)
print(sys.implementation.name)
print(sys.version_info)
print(sys.version)
linux
cpython
sys.version_info(major=3, minor=14, micro=3, releaselevel='final', serial=0)
3.14.3 (main, Feb  4 2026, 13:50:59) [GCC 13.3.0]
  • Python 3’s minor versions update relatively often
    • These add new features, deprecate or remove old ones
    • The Release Notes are the best place to keep track of the updates
  • There is also constant evolution of community packages

Things to Remember

  • Python 3 is the sole actively maintained and developed python version
  • It can be unclear what python is installed on a computer
    • Use --version or sys to verify