Unable to use Python matlab.engine in a Docker container

64 ビュー (過去 30 日間)
Eric Hamer
Eric Hamer 2016 年 12 月 29 日
回答済み: Marc Lasch 2018 年 6 月 5 日
I am attempting to install Matlab in a Docker container where I will be using the Python matlab.engine class. I am able to install Matlab silently and do a silent activation. These both succeed. I am also able to install this class via python setup.py install.
After this, when I bring up python in my container, I am able to import matlab.engine without issue. When I then try to execute: matlab.engine.start_matlab(), I get the following errors:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/matlab/engine/__init__.py", line 112, in start_matlab
eng = future.result()
File "/usr/local/lib/python2.7/site-packages/matlab/engine/futureresult.py", line 68, in result
return self.__future.result(timeout)
File "/usr/local/lib/python2.7/site-packages/matlab/engine/matlabfuture.py", line 87, in result
handle = pythonengine.getMATLAB(self._future)
matlab.engine.EngineError: Unable to launch MVM server: License Error
Why is this happening? I do have a valid license and this was specified when I did the install.
Thanks,
Eric Hamer
Quantiacs
  2 件のコメント
Walter Roberson
Walter Roberson 2017 年 1 月 3 日
At installation time on Linux, MATLAB offers to create a link in /usr/local/bin . That link might not have been created, or /usr/local/bin itself might not happen to be on your path.

サインインしてコメントする。

回答 (3 件)

Marc Lasch
Marc Lasch 2018 年 6 月 5 日
You need a ".lic" license file which should be copied to
.matlab/R2018a_licenses/
in your user's homefolder. However I had a problem with that license file because of the network interface in my container (which was host0). The license file is bound to a mac address in the machine. The virtual Ethernet interface of the container was not recognized by matlab (at least in a systemd-nspawn container).

Bo Li
Bo Li 2017 年 1 月 3 日
Does MATLAB itself run with the Docker container, for example:
matlab -nodesktop -r 'disp hello; exit'

Eric Hamer
Eric Hamer 2017 年 1 月 4 日
編集済み: Walter Roberson 2017 年 1 月 5 日
When I execute this: /usr/local/R2016b/bin/matlab -nodesktop -r 'disp hello; exit'
I get this as the response:
MATLAB is selecting SOFTWARE OPENGL rendering.
root@cff09122de9a:/install# -------------------------------------
Error: Activation cannot proceed. You may either:
1. Set an X11 display, and restart the activation process
2. Use the silent activation feature
3. Activate using the license center
------------------------------------------------------------------
While still in the container, I repeated the silent activation and it succeeded, but when I ran the above command, the result was the same.
Please advise.
Eric
  1 件のコメント
Guillaume Garreau
Guillaume Garreau 2017 年 6 月 23 日
hello, Have you found the solution?

サインインしてコメントする。

製品

Community Treasure Hunt

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

Start Hunting!

Translated by