Search code examples
pythondebuggingpycharmrelative-import

Pycharm python debugger cannot run files containing relative import


I tried to mark as Source root the folder that contains the file to debug, but unsuccessful.

[Pycharm link]https://intellij-support.jetbrains.com/hc/en-us/community/posts/360010615139-python-debugger-does-not-work-with-files-containing-relative-import

Below is my debug config: enter image description here

I am using Pycharm 2021.1 (Porfessional Edition)


Solution

  • You need to change the Working directory dropdown to .../pythonProject. Now your working dir is timeserio/batches/chunked where there is no temeserio package inside it.