Calling python using system function

조회 수: 2 (최근 30일)
KEN SUEMATSU
KEN SUEMATSU 2021년 1월 25일
댓글: KEN SUEMATSU 2021년 1월 25일
I try to run "python -V" using the system function.
[flag, cmdout] = system('python -V');
However, the flag returns an error of 9009.
Typing "Python -V" directly into the command prompt returns the Python version, so Python is already installed and passed through.
Is it not possible to use the system function to call "Python XX"?
I am using MATLAB 2020b, Python3.6.0

채택된 답변

the cyclist
the cyclist 2021년 1월 25일
Sounds like a path issue. Type
pwd
in MATLAB to get your directory, and then go to that directory on the command line and try
which python
I'm guessing you'll get "python not found".
  댓글 수: 1
KEN SUEMATSU
KEN SUEMATSU 2021년 1월 25일
It was a problem with the path!
Choosing the correct PATH solved the problem. Thanks!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Call 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