필터 지우기
필터 지우기

Hooking Matlab Online to a local Python installation?

조회 수: 2 (최근 30일)
Ravi Narasimhan
Ravi Narasimhan 2021년 8월 31일
댓글: Ravi Narasimhan 2021년 8월 31일
I have a Matlab Home license and access to Matlab Online. Is it possible to connect Matlab Online to a local Python installation?
I have tried setting pyenv('Version', 'local executable location') on several machines but get an error message.
Running pyenv by itself results in:
pyenv
ans =
PythonEnvironment with properties:
Version: "2.7"
Executable: "/usr/bin/python"
Library: "libpython2.7.so.1.0"
Home: "/usr"
Status: NotLoaded
ExecutionMode: InProcess

채택된 답변

Walter Roberson
Walter Roberson 2021년 8월 31일
You appear to be asking for python scripts executed started from MATLAB Online to execute in your local MATLAB Home instead .
In order to do that, on the MATLAB Online side, you would have to replace the py package with a package that intercepted the request and formed a TCP connection back to your MATLAB Home instance to request that the action be taken, and then the MATLAB Home session would have to report the result back to MATLAB Online.
That might perhaps be possible, but it would be a nuisance to set up. You could perhaps take advantage of PyRO or Parallel Python, but it would not be trivial . https://stackoverflow.com/questions/536370/execute-arbitrary-python-code-remotely-can-it-be-done
You cannot just configure the pyenv on MATLAB Online to tell it to execute on a remote system.
  댓글 수: 1
Ravi Narasimhan
Ravi Narasimhan 2021년 8월 31일
Thanks for the quick response. I have hooked Matlab Home (desktop) to my desktop Anaconda distribution and am experimenting with accessing various Python packages from within Matlab. I was wondering if that was possible with Online and it looks like it is not designed to do that.
It will be easy enough to do that exploration when I am at the desktop.

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

추가 답변 (1개)

Yongjian Feng
Yongjian Feng 2021년 8월 31일
Can you upload your python scripts to the online matlab server?
  댓글 수: 2
Walter Roberson
Walter Roberson 2021년 8월 31일
The python scripts would then not have access to the local filesystem or local devices, or to running programs that are installed on the MATLAB Home system but not on the MATLAB Online system (and which potentially cannot be installed because MATLAB Online runs Linux.)
Ravi Narasimhan
Ravi Narasimhan 2021년 8월 31일
Yes, in retrospect this seems like a bridge too far for a cloud application. I would have to install Anaconda on the Mathworks cloud and somehow point to it. Doesn't seem reasonable. I can do what I have in mind when I am at the Home (desktop) instance.

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

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by