Version 1.5.0

Hey @flight505 - if you’re launching Streamlit from PyCharm, the “supported” way to do it is to set up your Run/Debug Configuration like so:

  • set the “Script path” to your project’s virtual environment’s Streamlit script (I use Pipenv, and so mine looks like “/Users/tim/.local/share/virtualenvs/lib-Kyu3_XmQ/bin/streamlit”)
  • set the “Parameters” to “run [your_streamlit_app.py]”
  • ensure the Python interpreter is set to your virtualenv’s Python binary
  • and make sure the project’s working directory is the directory that houses the main app script.

For example, here’s how I launch a Streamlit app called “streamlit_app.py”, which lives in my “/Users/tim/export/corp-streamlit” directory:

(If you’re on Mac or Linux, a quick way to get the path of your environment’s streamlit script is to do $ which streamlit from a terminal that you’ve activated the venv within.)

4 Likes