It is my understanding that you are getting the error “Unable to resolve the name py.myfunc” while trying to run a Python function in MATLAB R2022a.
MATLAB automatically loads Python when you type py. followed by a Python statement at the MATLAB command prompt. If MATLAB displays this message, a failure has occurred in the call to myfunc.
Unable to resolve the name py.myfunc
Please refer to the below documentation page to troubleshoot the failure: