Error running Standalone exe with custom python function

8 ビュー (過去 30 日間)
Thomas McVay
Thomas McVay 2021 年 8 月 25 日
回答済み: Kumar Pallav 2021 年 10 月 25 日
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

採用された回答

Kumar Pallav
Kumar Pallav 2021 年 10 月 25 日
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 件)

カテゴリ

Help Center および File ExchangeCall Python from MATLAB についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by