7

Information

I faced an annoying thing with PyCharm in the last couple of days. I'm trying to use ipdb to debug my program instead of pycharm debugger but I can only open it in thepycharm i/o console or in the python console.

Question

Is there anyway that I can open the debugging session in the terminal window? or even in a new terminal window? I alos want to be able to open the session from the debugging button, and don't write any line like python src/main.py by my self in the terminal

The main reason I want to do it so I can have an auto complete as I get from ipython in the terminal, but I couldn't find a way to open the debugging session in terminal window, is there anyway to do it? and plugin that can help? the autocomplete that the python console gives me is very weak and not really helping me

System information

Pycharm 2018.3

Centos 7 64bit

Reznik
  • 2,663
  • 1
  • 11
  • 31

1 Answers1

2

Updated

Here is a simple workaround that you can fork an open-source project from git and add a patch for persistent history. To install IPDB you can use the following command to fork the latest version:

pip install git+https://github.com/gotcha/ipdb.git

To install git projects using pip, visit pip install from git repo branch. Just make sure that your IPython version is 6.0 or higher.

Implementation Info: can be found in these Articles. Visit references: Use of IPDB and IPDB Persistent History .

Otherwise, you can also use pudb instead. It enables getting to a real ipython shell from the debugger and all the commands there are saved.


To launch Debugging Session, go to Pycharm Windows-Tool-Bar at the bottom and right click on terminal as follows:

To Open Terminal in Window Mode:

To Open Terminal in Window Mode:

When terminal is open in window mode, then you can open multiple debugging sessions as given below:

  • [ + ] to open multiple Sessions:*

 **+** to open multiple Terminals:

At the end you can use the following command to launch debugging sessions using this command:

$ python -m ipdb /path/my_test.py

This will initiate your debugging session using IPDB in PyCharm terminal window.

Here is a test result: Pycharm Debugging Session using IPDB:

Muhammad Usman Bashir
  • 1,441
  • 2
  • 14
  • 43