Home How to run a matlab exe which contains python commands from another python code?
Reply: 1

How to run a matlab exe which contains python commands from another python code?

Sahel Fallahdoust
1#
Sahel Fallahdoust Published in 2017-12-06 20:18:51Z

I have a Matlab code which calls some python modules. I made an exe from this Matlab code (let's call it pipeMe.exe) now I'm trying to run pipeMe.exe from another python code in another machine of course but apparently, it can't set the python version executable path from the second machine, thus it gives me this error:

Undefined variable "py" or class "py.sys.path".

Is there any way that I can set the pyversion executable from outside of Matlab while I run pipeMe.exe ? Or is there any possibility to set the pyversion executable path to a path that is accessible from both machines, and I just have to set it at the beginning of my pipeMe matlab code?

Thanks in advance for your help.

Kardi Teknomo
2#
Kardi Teknomo Reply to 2017-12-09 09:49:55Z

Since your Matlab code has been compiled into executable (.exe), you can call it in Python using subprocess.Popen("pipeMe.exe")

If your exe file does not run, try to use deploytool of Matlab.

See also:

  • Calling an external command in Python
  • https://www.mathworks.com/matlabcentral/answers/4864-how-to-run-standalone-exe-file-on-computer-without-matlb
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.549058 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO