Q:

Updating Python module in Matlab

I'm trying to run a Python script using Matlab's built-in py. It's pretty simple, but I'm running into some difficulty drying to debug an error in my code (which runs fine testing in my Python IDE but crashes when run through Matlab).
The issue is that Matlab seems to be caching the module the first time I call a function, and I can't figure out how to get it to recognize changes to the module without restarting Matlab. Is anyone aware of a way to avoid this issue?

A:

This is the first limitation listed on the MATLAB documentation's Limitations to Python Support page:

Editing and reloading a Python® module in the same MATLAB session. To
  use an updated module, restart MATLAB

Sorry. That said, that page might help you figure out what the issue is, as there are other limitations that might be coming into play. You might also find their page about troubleshooting Python errors useful.

