ipython / ipython/ipykernel

How can i show an input box when debugging using pdb?

Abierto
#586 1 comentario 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
734
Forks
412
Merge medio
1 d 5 h
PR fusionados (30 d)
8

Descripción

When i try to debug with `from IPython.core.debugger import Pdb; Pdb().set_trace()` or `import ipdb; ipdb.set_trace()`, jupyter doesn't show an input box for debugging. Even if I restart kernel and run the code again, it doesn't show the input box. Here is the cell output.
![Screenshot from 2021-01-28 23-47-08](https://user-images.githubusercontent.com/76247476/106155562-29573f00-61c4-11eb-9ce9-09187dec313b.png)

I was expecting like this.
![https___qiita-image-store s3 amazonaws com_0_10290_3c195522-a68b-5610-c070-ca60b63afcc3](https://user-images.githubusercontent.com/76247476/106156312-b601fd00-61c4-11eb-809d-b99c5234b4c8.png)

> For those reproducing this:
>
> ```python
> def my_sum(initnum, step, n):
> x = initnum
> from IPython.core.debugger import Pdb; Pdb().set_trace()
> for i in range(n):
> x = x + step
> return x
> my_sum(10, 2, 3)
> ```

When i try this on jupyter lab, it worked! but when i store the code in a file and ran `!python pdb_test.py` , it didn't show an input box.
![Screenshot from 2021-01-29 15-22-26](https://user-images.githubusercontent.com/76247476/106239457-fce40700-6245-11eb-9213-e30a135e9872.png)

but running py file with the code :/
![Screenshot from 2021-01-29 15-25-25](https://user-images.githubusercontent.com/76247476/106239658-52b8af00-6246-11eb-9dfa-e13092004f51.png)

pdb_test.py
![Screenshot from 2021-01-29 15-27-25](https://user-images.githubusercontent.com/76247476/106239832-99a6a480-6246-11eb-91f9-5db8307b2c19.png)

Here is my environment
```

conda list ipython
# packages in environment at /home/zzz/anaconda3:
#
# Name Version Build Channel
ipython 6.1.0 py36hc72a948_1
ipython_genutils 0.2.0 py36hb52b0d5_0

```

```
jupyter-lab --version
3.0.5
```
ubuntu 18.04

Google Chrome
Version 88.0.4324.96 (Official Build) (64-bit)

I posted this issue first here **https://github.com/jupyterlab/jupyterlab/issues/9691**

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.