Calling python using system function

2 visualizaciones (últimos 30 días)
KEN SUEMATSU
KEN SUEMATSU el 25 de En. de 2021
Comentada: KEN SUEMATSU el 25 de En. de 2021
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

Respuesta aceptada

the cyclist
the cyclist el 25 de En. de 2021
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 comentario
KEN SUEMATSU
KEN SUEMATSU el 25 de En. de 2021
It was a problem with the path!
Choosing the correct PATH solved the problem. Thanks!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Call Python from MATLAB en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by