Skip to content

Instantly share code, notes, and snippets.

@EonYang
Created July 14, 2020 19:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EonYang/f9cda60427cd95d0c9810ea1a010b31a to your computer and use it in GitHub Desktop.
Save EonYang/f9cda60427cd95d0c9810ea1a010b31a to your computer and use it in GitHub Desktop.

streamlit/streamlit#648 (comment)

Hey @andaag -

I don't think we've tested Streamlit with ptvsd, so I can't comment on that particular plugin. (The awesome-streamlit project is created by an (awesome!) Streamlit community member, so the doc you're following doesn't come from us.)

I use PyCharm for all my Python debugging, so I'm not a VScode expert, but I was able to get a Streamlit debugging session working without any third-party plugins.

I edited my project's launch.json file (see here for more details on creating that file), and added a new launch configuration:

{
    "name": "Streamlit: Current File (Integrated Terminal)",
    "type": "python",
    "request": "launch",
    "program": "/Users/tim/.local/share/virtualenvs/lib-CDRh8goq/bin/streamlit",
    "args": [
        "run",
        "${file}"
    ],
    "console": "integratedTerminal"
},

The "program" argument here is the path to bin/streamlit within my local virtual environment, so you'll need to replace it with the correct path for your setup.

The "args" values here are just telling VScode to run streamlit run ${file}, where ${file} gets replaced with the currently active VScode file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment