Run ipdb with seperate terminal in pycharm
Asked Answered
C

1

8

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

Cumming answered 8/11, 2019 at 13:30 Comment(4)
Why do you want use ipdb instead of PyCharm console?Proselytize
You can try using this package I wrote, github.com/kmaork/madbg - allows you to use ipdb from a remote terminalShantay
@Proselytize well i want the autocompletion that i get from ipythonCumming
@Shantay its cool, but im searchig for thing that allow me to open debug session on the terminal from pycharmCumming
E
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:

Equality answered 14/11, 2019 at 17:33 Comment(6)
This is not answering my question. i asked to open a debug session from the pycharm debug buttonCumming
@Renzik : Kindly Look this part of your question - Is there anyway that I can open the debugging session in the terminal window? or even in a new terminal window?Equality
@MuhammadUsman i want to be able to press the debug button to do itCumming
@Reznik, I have updated my answer to give you a more feasible workaround.Equality
@Cumming have you tried to install IPDB using this pip install git+https://github.com/gotcha/ipdb.git?Equality
@MuhammadUsman I know how to use pdb/ipdb... i updated my questionCumming

© 2022 - 2024 — McMap. All rights reserved.