Error running Standalone exe with custom python function
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Thomas McVay
el 25 de Ag. de 2021
Respondida: Kumar Pallav
el 25 de Oct. de 2021
I am running a standalone matlab exe that calls a python function "function_name" from module "module_name.py". When running the exe I receive error
- Warning: Python commands require a supported version of CPython. See <a href="matlab:helpview([docroot '/matlab/helptargets.map'], 'getting_started_python_interface')">Getting Started with Python</a>.
- Unable to resolve the name py.module_name.function_name
Python 3.9 is running on both desktops. Function call works on main pc before being complied. Py module was included in required files when complied. Im still new to all of this,particurly python, so any help would be appreciated. Thank you
0 comentarios
Respuesta aceptada
Kumar Pallav
el 25 de Oct. de 2021
Hi,
To call python modules from MATLAB, you must have a supported version of the reference implementation (CPython) installed on your system. The versions of python compatible with MATLAB is mentioned in this document. For MATLAB version 2020b, supported python3 version are 3.6,3.7,3.8.
For the error, "Unable to resolve the name py.module_name.function_name", please check the python path and make sure that it contains an absolute path to the directory where this Python module is saved.
Use following command to check the path:
py.sys.path
Add the directory of the python module if it does not exist in the path.Please refer this document to troubleshoot the issue.
Hope this helps!
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Call Python from MATLAB en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!