DEV Community

chuongmep
chuongmep

Posted on

How to Fix FastAPI Debug Not Working in PyCharm on Windows

If you are developing a FastAPI application in PyCharm on Windows, you might run into this issue:

Problem: You start the debugger, it runs, but code changes are not reflected on reload.

I ran into this recently, and here’s what fixed it for me: downgrading Python from 3.12 to 3.11.

Here’s the step-by-step solution:

  1. Create a new environment In PyCharm, create a new virtual environment (e.g., .venv) using Python 3.11.

  1. Configure Python Debug Go to your Run/Debug Configurations and select the new environment. Make sure the “Python interpreter” points to your .venv.

  1. Start Debug Run the debugger. Now, changes in your code should properly reload and reflect in the application.

This simple downgrade solved the reload issue on Windows.

Top comments (0)