Skip to content Skip to sidebar Skip to footer

Python Idle, Importing Xlrd, Error Generated In Debug Mode: Attributeerror: '_modulelock' Object Has No Attribute 'name'

I'm a newbie to Python and this is the first time I've tried debug mode. I've read the answers to almost similar questions on stackoverflow but none of them seem to address this si

Solution 1:

I thought I had the answer but evidently not. I imported openpyxl instead of xlrd, into the hello world code. Same error with the break-point on the same line. I was going to say "back to the drawing board", but I think I'll just work on something else. Very disappointing!

Solution 2:

This is probably a duplicate of this question, but I haven't answered there yet. This also appears to be a duplicate of this two year old tracker issue.. I recently found what I believe to be the answer but have not written a patch yet. There is a simple change needed that improved the situation, discussed in the last 3 messages of 4/22 and 4/23. In /Lib/idlelib/debugger_r.py, line 173, in dict_item, change

value = repr(value)

to

value = reprlib.repr(value)

and add at the top

import reprlib

EDIT Jan 10, 2021: Changes have been applied for https://bugs.python.org/issue33065 and will be in next releases of 3.8, 3.9, and 3.10.

Post a Comment for "Python Idle, Importing Xlrd, Error Generated In Debug Mode: Attributeerror: '_modulelock' Object Has No Attribute 'name'"