Error 'Python est introuvable'

35 ビュー (過去 30 日間)
Nathalie Brun
Nathalie Brun 2021 年 6 月 28 日
回答済み: Tejas 2024 年 2 月 23 日
Hi
I am on Windows 10
I configured the environment such as :
Status: Loaded
ExecutionMode: InProcess
ProcessID: "8804"
ProcessName: "MATLAB"
When I try to run the Python code with :
system('python python/vae_keras_ems_train.py')
I get the message :
Python est introuvable. ExÚcutez sans argument pour procÚder Ó l
ans =
9009
Thanks !

回答 (1 件)

Tejas
Tejas 2024 年 2 月 23 日
Hello Nathalie,
It seems you are encountering the "Python not found" issue. To resolve this, please follow the steps outlined below.
Firstly, ensure that the version of Python you are using is compatible with your MATLAB version. You can refer to the following documentation for guidance: https://www.mathworks.com/support/requirements/python-compatibility.html?s_tid=srchtitle_site_search_1_python%20compatibility#:~:text=3.7%2C%203.8%2C%203.9-,R2021a,-2.7%2C%203.7%2C%203.8 .
Next, verify that Python is added to the "Environment Path" variables. If it is not, you can add it by going to the Start Menu, typing "Edit environment variables for your account," and then selecting "Path" under User variables. Click "Edit" and enter the path to your Python executable.
Now, in the MATLAB command window, type the following command:
>> pyenvpyenv( 'Version', 'path_to_python_executable', 'ExecutionMode', 'OutOfProcess');
This command will link Python to MATLAB. To verify whether the linking is successful, type the following command in the MATLAB command window:
>> pyenv
This will display the Python version and the path to the Python executable file.
Ensure that you add the Python file you wish to run to the MATLAB path. This will enable you to successfully execute the Python file using the "system" function call.
To learn more about pyenv function, follow the guidelines in this documentation:
Hope it helps!

カテゴリ

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

タグ

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by