Calling python using system function

2 次查看(过去 30 天)
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