py.list bug in R2024a
56 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Tom Grieve
il 23 Lug 2024 alle 19:14
Commentato: Steven Lord
circa 19 ore fa
I believe I'm experiencing a bug in R2024a with py.list. After a clear all, I get the error No module or function named 'list'.:
clear all;res = py.list({"Name1","Name2","Name3"});
In this interface, the code runs just fine. When I run it locally, I get this:
>> clear all;res = py.list({"Name1","Name2","Name3"})
No module or function named 'list'.
I can get py.list to work again if I use another Python command. For example, this works:
>> handlers = py.logging.getLogger().handlers;
>> res = py.list({"Name1","Name2","Name3"});
>> clear all;res = py.list({"Name1","Name2","Name3"});
No module or function named 'list'.
I'm running MATLAB Version: 24.1.0.2628055 (R2024a) Update 4. I cannot replicate on R2023b.
0 Commenti
Risposta accettata
Steven Lord
il 23 Lug 2024 alle 20:01
4 Commenti
Steven Lord
circa 19 ore fa
We tweaked the summary of the bug report to include part of the error message, hopefully that will make it more discoverable when people search for it.
Più risposte (1)
Avni Agrawal
il 23 Lug 2024 alle 19:49
I understand that you are encountering an error when trying to access Python classes after using clear all in the command line for the R2024a release. I experienced a similar issue, and I found a workaround that worked for me. Executing clear classes allows MATLAB to locate and recreate the Python modules. For example:
clear all;res = py.list({"Name1","Name2","Name3"});
clear classes;
res = py.list({"Name1","Name2","Name3"});
I hope this helps!
Vedere anche
Categorie
Scopri di più su Call Python from MATLAB in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!