Debugging PyTauri
VS Code
For Python, see this link. JavaScript can be debugged by running npm run tauri dev
in debug mode.
JetBrains IDEs
Webstorm - for frontend development
- Add a new run configuration -> npm
- Command:
run
, Scripts:tauri
, Arguments:dev
- Add a new environment variable named
VIRTUAL_ENV
. Its value should be an absolute path pointing to the virtual environment, e.g.C:\Users\...\...\pytauri-project\.venv
.
PyCharm - for python development
Requires PyCharm professional
- Set the python interpreter (should be the
python.exe
in.venv\Scripts
). - Open a terminal, make sure the virtual environment is activated.
- Install pydevd for PyCharm.
uv pip install pydevd-pycharm
INFO
The specific version of pydevd-pycharm
depends on your PyCharm version. Using the latest version might result in a warning but should generally work.
- Add the following code to the top of
__init__.py
python
import pydevd_pycharm
pydevd_pycharm.settrace('localhost', port=5678, stdoutToServer=True, stderrToServer=True)
- Add a new run configuration -> Python Debug Server
- IDE host name:
localhost
, Port:5678
- Run the Python Debug Server before starting the npm server.
You can now set breakpoints as you usually would to debug your python code.