Can I use Streamlit within a PyCharm development environment?

I have successfully run Streamlit from the shell, eg:

streamlit run mypythonscript.py

Here Streamlit is the host application, getting the output from calls within the python script, eg:

streamlit.dataframe()

My question: Is it possible to run Streamlit where my python script is the host?

Specifically, I would like to use Streamlit to allow me to browse through a dataframe that I have created within my python code. In essence similar to what one can do with matplotlib to plot data from within python.

Thx.

1 Like

Hi @miglto, welcome to the Streamlit community!

Yes, you can run Streamlit from PyCharm in the same way you can run it from VSCode, Spyder, etc. In PyCharm, there is a terminal where you can run streamlit run app.py, and you can keep app.py open in PyCharm as a Python script. Every time you hit save on the script, the Streamlit app will change to reflect the results.

Thx.

Iโ€™ll piggyback on this question: how about debugging? Iโ€™ve issues with pydevd and a streamlit script that asks for arguments.

PyCharmโ€™s run configuration looks like this: it runs the script with its own parameters, the interpreter parameters are set like -m streamlit.cli run --, the double dash at the end to explicitly tell it that the following arguments belong to the script. Unfortunately, due to this the script command line arguments are not given to the script but to pydevd, that thereupon correctly complains about wrong parameters.

So how can I use PyCharm debugging with a streamlit app?

3 Likes

hello, i have a problem with streamlit and pycharm. I made the installation but thne it didnt recognized. what i do wrong?

when i run n the terminal the streamlit run app.py i get this error

streamlit : The term โ€˜streamlitโ€™ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1

  • streamlit run app.py
  •   + CategoryInfo          : ObjectNotFound: (streamlit:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException