PyCharm debug console not working

11,310

Solution 1

Click on the button Show Python Prompt.

enter image description here

In order to have the prompt automatically appear, go to Preferences>Build, Execution, Deployment>Console> check Always show debug console

Solution 2

Adding -s to 'Additional Arguments' in the run configuration helped me with the same issue.

Solution 3

This is a known issue but the workaround is to add JB_DISABLE_BUFFERING into your environment variables (no value needed for this key) of your run/debug configuration. This resolved the issue for me on Pycharm Professional Edition 2017.1.5

Solution 4

I'm on PyCharm 2019.2 and I had to check the Execution > Run with Python Console checkbox in the Run/Debug Configurations to resolve this issue.

Solution 5

I had the same problem with PyCharm 2020.3 (and earlier versions) under Ubuntu 20.04 with MATE. From the answers and comments it seems that there are multiple possible reasons for this behaviour.

In my case, the debugger console responded at some breakpoints (e.g. near the beginning of the program), but not for others.

What fixed the problem for me is enabling the "Gevent compatible" checkbox the File → Settings → Build, Execution and Deployment → Python Debugger (not "Debugger").

Screenshot of Settings dialog

Relevant YouTrack issue (PY-9372)

Share:
11,310

Related videos on Youtube

The Cat
Author by

The Cat

Recent computer science graduate working as a Java developer in London, the best city in the world.

Updated on June 18, 2022

Comments

  • The Cat
    The Cat about 2 years

    I can run the debugger and put breakpoints to active the console but it appears as if the console doesn't pick up the code I am entering.

    I can just type anything but I don't get any ouput,

    a=2
    print(a)
    sfgsmk
    ..g.bbcvdgdggh
    

    Any ideas how I can get the debug console to run the code I am typing and how to get it to show output.

    I am using Community Edition 2017.1.4

  • Mike91
    Mike91 almost 7 years
    This is exactly what is broken.
  • nanotek
    nanotek over 6 years
    There's a related issue regarding pytest which is still open. This solution seems to work for me as well as the recommended solution of adding -s to the arguments.
  • n1000
    n1000 over 5 years
    Isn't there an option to load / show the prompt at break automatically? In another project PyCharm does load it, but I can't find the option...
  • Antonio Miras
    Antonio Miras almost 4 years
    No solution seem to work for me with PyCharm 2020 1.2, Windows 10
  • nog642
    nog642 about 3 years
    Ah thanks, I was looking for exactly this option. Seems it is checked by default now, and I wanted it unchecked. Couldn't find it in the settings myself.
  • 임정섭
    임정섭 about 3 years
    I don't see 'Additional Arguments' in the run configuration on pycharm 21.03. Do you mean Parameters or Interpreter options? @karu
  • Leonardo Hermoso
    Leonardo Hermoso almost 3 years
    This does not answer the question!
  • swimmer
    swimmer almost 3 years
    'Additional Arguments' is not available for a 'Python Run Configuration' (but it is e.g. for a 'Python pytest Run Configuration')