Streamlit on Mac

Hi, I have just install Streamlit on Mac using pip3 install streamlit.

On one machine, i can just type streamlit in terminal but the having no command found for the other mac.

I found the Streamlit is stored in /Library/Frameworks/Python.framework/Version/3.12/bin/streamlit

How can I make it accessible, similar to the first Mac that I can just type streamlit in ther terminal?

Thank you

Uploading: streamlit.jpg…

Hi @WKN, welcome to the forum!

There are a few potential approaches to solve this:

Direct solution

The most direct solution is to add /Library/Frameworks/Python.framework/Version/3.12/bin/ to your PATH, so that when your terminal looks for commands that it can run, it also looks in that directory.

You can do that by running

export PATH="/Library/Frameworks/Python.framework/Version/3.12/bin/:$PATH"

If you want it to be permanent, you can add that line to ~/.zshrc or ~/.bashrc, depending on what shell you are using.

Indirect, but more general solutions

  1. Use a virtual environment (RECOMMENDED)

    There is a good guide to that here: Install Streamlit using command line - Streamlit Docs

  2. Use a tool designed for installing python packages globally

    You can install uv (Installation | uv) and then run uvx streamlit if you just want access to streamlit anywhere on your machine.

    You can similarly use pipx GitHub - pypa/pipx: Install and Run Python Applications in Isolated Environments

Hope those are helpful!

Hi Blackary,

Thank you.

I am a noob, mind explaining export PATH=“/Library/Frameworks/Python.framework/Version/3.12/bin/:$PATH”

I am using Mac zsh.

Thank you again

Hi @WKN,

Sorry, I missed this :man_facepalming:

For anyone looking at this in the future, that effectively does “Add /Library/Frameworks…/bin/ to the beginning of the PATH”

So, when I type streamlit, it looks various places (including the current folder) for a program called streamlit. If it’s not in the current folder, then it looks at the PATH variable to see what folders to look in.

Again, my strong recommendation is not to do it this way, but it should work.