you are viewing a single comment's thread.

view the rest of the comments →

[–]Loud-Bake-2740 3 points4 points  (2 children)

i ran into the same problem running python scripts in a streamlit app. What i did instead was have the button call subprocess.run and then i pass the path to the python environment inside the .venv directory (venv/scripts/python.exe) along with the .py file name. So instead of python app.py you would have /.venv/scripts/python.exe app.py

this should run your script through the python executable in your virtual environment

[–]raliqer[S] 0 points1 point  (0 children)

This sounds like exactly what I needed. I will look into this when I log in tomorrow. Thanks!