Open Laivetta opened 4 years ago
when i try to debug a file in python, the kernel stop and restart, every time
[SpyderKernelApp] WARNING | No such comm: 062ae948fd3211eaa90800090ffe0001
[SpyderKernelApp] WARNING | No such comm: 062ae948fd3211eaa90800090ffe0001 [SpyderKernelApp] WARNING | No such comm: 4dde740dfd3211ea887100090ffe0001 [SpyderKernelApp] WARNING | No such comm: 619e6fe5fd3211ea9c6400090ffe0001 [SpyderKernelApp] WARNING | No such comm: 90498814fd3211eaaf2500090ffe0001
Hi @Laivetta,
Can you please give me a snippet of code that I can use to try and reproduce your error?
Hi Steff, the "warning" i cant reproduce, but the kernel stop is with any code, for example just
var = "hello world" print (var)
well, when i tried, can reproduce the error:
`
debugfile('C:/Users/Usuario/Desktop/Python/Pandas/documentacion.py')
Kernel died, restarting
Restarting kernel...
[SpyderKernelApp] WARNING | No such comm: eb40a0f2fd7e11ea9ccc00090ffe0001 [SpyderKernelApp] WARNING | No such comm: f25998bdfd7e11eaaec100090ffe0001 [SpyderKernelApp] WARNING | No such comm: feec2a1dfd7e11eab84800090ffe0001 [SpyderKernelApp] WARNING | No such comm: 0f155d32fd7f11eaa5a200090ffe0001
`
`import os from docx2python import docx2python import PyPDF2
""" ------------------ PDF ---------------------"""
archivo_pdf = open('1.pdf', 'rb') pdfReader = PyPDF2.PdfFileReader(archivo_pdf) num_page_pdf = pdfReader.numPages print(num_page_pdf) archivo_pdf = []
for p in range(num_page_pdf): pageObj = pdfReader.getPage(p) print("esto es pdf ...:" , archivo_pdf, "\n " , pageObj.extractText())
""" ------------------- DIRECTORIO ------------------------"""
root = 'C:/Users/Usuario/Desktop/Trabajo Pa/Cierre BI cero 25841 y 26292/6 prueba'
directorios=[] for x in os.listdir(root): if not os.path.isdir(x): directorios.append (x)
for x in directorios:
dir1 = root + "/" + x
archivos = []
for y in os.listdir(dir1):
if os.path.isfile(dir1 + "/" + y):
archivos.append(y)
buscados = "doc"
encontrados = [i for i in archivos if buscados in i]
print("archivos de word" , encontrados)
for d in encontrados:
file = dir1 + "/" + d
text = docx2python(file)
print (text.body)
print("el directorio es ->" , x, " --------- " "los archivos son -> ", archivos)
#
file = 'C:/Users/Usuario/Desktop/Python/Pandas/.idea/1.doc'
text = docx2python(file) print (text.body) #
if text.images != 0: print ("tiene imagenes pegadas") # #
#
# # `
Sorry for the previus msg, I clean the code:
import os
from docx2python import docx2python
import PyPDF2
""" ------------------ PDF ---------------------"""
archivo_pdf = open('1.pdf', 'rb')
pdfReader = PyPDF2.PdfFileReader(archivo_pdf)
num_page_pdf = pdfReader.numPages
print(num_page_pdf)
archivo_pdf = []
for p in range(num_page_pdf):
pageObj = pdfReader.getPage(p)
print("esto es pdf ...:" , archivo_pdf, "\n " , pageObj.extractText())
""" ------------------- DIRECTORIO ------------------------"""
# breakpoint()
#root = 'C:/Users/Usuario/Desktop/Python/Pandas'
root = 'C:/Users/Usuario/Desktop/Trabajo Pa/Cierre BI cero 25841 y 26292/6 prueba'
# files = [f for f in os.listdir(root) if os.path.isfile(f)]
# directorios = [f for f in os.listdir(root) if os.path.isdir(f)]
directorios=[]
for x in os.listdir(root):
if not os.path.isdir(x):
directorios.append (x)
# print ("cantidad archivos. :", len(files), "--------", "archivos -->: ",files)
# print ("directorios -> ", directorios, "\n")
for x in directorios:
dir1 = root + "/" + x
archivos = []
for y in os.listdir(dir1):
if os.path.isfile(dir1 + "/" + y):
archivos.append(y)
buscados = "doc"
encontrados = [i for i in archivos if buscados in i]
print("archivos de word" , encontrados)
for d in encontrados:
file = dir1 + "/" + d
text = docx2python(file)
print (text.body)
print("el directorio es ->" , x, " --------- " "los archivos son -> ", archivos)
#
# #
# """ ------------------- WORD ------------------------"""
file = 'C:/Users/Usuario/Desktop/Python/Pandas/.idea/1.doc'
text = docx2python(file)
print (text.body)
#
# print(text.header)
if text.images != 0:
print ("tiene imagenes pegadas")
#
#
# """extre las imagenes pegadas de word"""
#
# for key,val in text.images.items():
# f = open(key, "wb")
# f.write(val)
# f.close()
Can you please upload a gif with the behavior you are having while debugging?
Well, the "warmings" is random, but the kernel died is always
Hey @Laivetta, this seems a problem with your code or a bug in the libraries you're using on it, not an issue with Spyder.
Are you able to run it outside Spyder? For instance in a Jupyter notebook or in a terminal with python my_file.py
? (my_file
stands for the name of your file).
I run my code in a terminal and run ok. The code run ok in spyder. The problem is when i tried to run in debug way . The gif that i send is when i tried to debug
Ok, thanks for the clarification. I reformatted your code above (I hope that's ok), but it's not possible for us to run it because it depends on external files we don't have.
Could you also upload 1.pdf
and 1.doc
? If it's not possible here, pleas try to do that somewhere else.
Ok no problem. Now its late. Tomorrow in the morning. But this problem was with diferent code. Hello World not Work too.
Ok no problem. Now its late. Tomorrow in the morning.
Thanks for your help!
Hello World not Work too.
What do you mean by this?
Here are the files. Remember, the problem is with the Debug Mode files.zip
@steff456, please try to reproduce @Laivetta's problem on Windows.
Description
What steps will reproduce the problem?
when i tried to debug a program, the kernel stop
Versions
Dependencies