appendix

appendix  Installing Python and Streamlit

 

This appendix covers

  • How to check the iinstalled Python version (if any)
  • Installing Python on macOS and Windows
  • Using pip to install Streamlit

Depending on the operating system, you may need to follow slightly different steps to get Streamlit working. This guide covers these steps for the two dominant desktop operating systems—macOS and Windows.

A.1 Checking the current Python version

Streamlit supports Python versions 3.10 and above, so if you have an older version, you need to install a newer one. To check the Python version installed on your system, or whether Python is installed at all, open a terminal window (Terminal on macOS and Command Prompt or, better yet, PowerShell on Windows) and enter:

python --version

or

python -V

If you don’t have Python installed, this will give you some kind of error, like:

'python': command not found

or

'python' is not recognized as an internal or external command, operable program or batch file.

or

'Python' was not found; run without arguments to install from the Microsoft Store

If you do have Python installed, the command returns a version number like this:

Python 3.7.3

If this version number is 3.10 or above (e.g., 3.10.0 or 3.12.2), you’re good. If it’s lower than 3.10 (as shown here), install a later version.

A.2 Installing the right Python version

This section provides instructions on how to install the right version of Python on Windows and macOS.