elazarcoh / simply-view-image-for-python-debugging

visual studio code extension simply view the image of the image variables when debugging python
https://marketplace.visualstudio.com/items?itemName=elazarcoh.simply-view-image-for-python-debugging
MIT License
57 stars 6 forks source link

NameError: name '_python_view_image_mod' is not defined #56

Closed scowalt closed 1 year ago

scowalt commented 1 year ago

I'm running VSCode inside of a docker container. I noticed that this extension doesn't work!

Here's my log (with some parts redacted): https://gist.github.com/scowalt/013583f667a8b9be44a0dfe964cd8fd4

scowalt commented 1 year ago

Looks like this is a potential dupe of #21 , though that one was closed

elazarcoh commented 1 year ago

I'm missing some essential parts of the logs. The error you notes indicates the extension had failed to setup itself with the debugging session. This setup step does occur on a breakpoint hit, I don't see any breakpoint got hit in the log you attached. Breakpoint event is indicated by a json entry with:

"onDidSendMessage" {
  "type": "event",
  "event": "stopped",
    // ...
}

Also, the setup should send large chunk of code to the debug session, hard to miss it. If an error would have occur, I can use the log to trace it, hopefully. So, all in all, please see if you have more of the log to share. Thanks

scowalt commented 1 year ago

Here's another log. I've made sure this one included an "event": "stopped" event

I've had to remove chunks of the log to avoid source leaks. I noticed that there are some errors:

Error finding viewables from expression `<file source code>`. Error: Syntax Error
elazarcoh commented 1 year ago

it is possible that the issue is as here: https://github.com/elazarcoh/simply-view-image-for-python-debugging/issues/46#issuecomment-1471510064_ TLDR install matplotlib and see if the issue persists.

scowalt commented 1 year ago

Amazing! Installing matplotlib fixed it, thank you so much for the help!

Maybe some sanity check code could be added to check for matplotlib and toast errors if it's not found? Could probably save the next person some time.

elazarcoh commented 1 year ago

Yeah, but it's more of a bug, as matplotlib lib is not needed for the extension functionality. dup of #54