Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build MATLAB Engine for Python #22

Open
ghost opened this issue Aug 30, 2021 · 11 comments
Open

Cannot build MATLAB Engine for Python #22

ghost opened this issue Aug 30, 2021 · 11 comments

Comments

@ghost
Copy link

ghost commented Aug 30, 2021

I do not know what I am doing at this point, but here is my YML:
https://github.com/apommel/vscode-matlab-interactive-terminal/blob/84219db/.github/workflows/ci.yml

It appears I am trying to "build a wheel from code stored in a mounted storage account".
I'd be making a temp directory, copy things over and that would get the build working:
https://stackoverflow.com/questions/63243930/

Maybe there needs to be an action for building MATLAB Engine for Python that handles the VM issue?

@acampbel
Copy link
Member

acampbel commented Aug 30, 2021

hi there, thanks for trying these actions. You may be able to build the engine by building and installing in non-default locations.

However, even if you can build and install it you may run into licensing issue similar to this issue when you try to run the engine. Do you find yourself in the same situation?

@mcafaro
Copy link
Member

mcafaro commented Aug 30, 2021

You can workaround this issue by specifying the --build-base option as shown:

    - name: Install MATLAB Engine for Python
      run: |
        cd /usr/local/MATLAB/R2021a/extern/engines/python
        python setup.py build --build-base=$(mktemp -d) install --user

Note that you will not be able to call matlab.engine.start_matlab() however (it will fail with a licensing error) as our cloud based licensing currently occurs upon MATLAB startup and the MATLAB engine for Python does not yet support this licensing scheme.

@ghost
Copy link
Author

ghost commented Aug 30, 2021

Argh crap. Any hope of creating a license secret and supporting it in MATLAB?
Something for R2021b perhaps?

@ghost
Copy link
Author

ghost commented Aug 31, 2021

I submitted a service request (05045850) and I hope this ships with R2021b or R2022a

@mcafaro
Copy link
Member

mcafaro commented Sep 1, 2021

Thanks. We're discussing how we might support this use-case. I'll post on here with any updates.

@ghost
Copy link
Author

ghost commented Mar 11, 2022

Did R2022a fix this? 🤔

@mcafaro
Copy link
Member

mcafaro commented Mar 18, 2022

Hi @sndst00m,

A fix for this won't necessarily be tied to a release. We need to figure out a licensing approach that can support this workflow first. That may take some time if we can get it approved.

In the meantime, using a self-hosted runner where you have pre-installed and licensed MATLAB is a potential workaround.

Best,
Mark

@zaikunzhang
Copy link

Hi @mcafaro ,

Is MATLAB Engine for Python available now if I use GitHub-hosted runners?

Thank you.

Zaikun

@mcafaro
Copy link
Member

mcafaro commented Apr 26, 2024

Hi @zaikunzhang,

MATLAB Engine for Python is available but starting MATLAB from Python is not supported with our automatic licensing approach for public repositories. Using a self-hosted runner with a pre-installed and licensed version of MATLAB is still the best workaround available.

-Mark

@skjerns
Copy link

skjerns commented Jan 7, 2025

@mcafaro is it possible to request a batch token for this use case?

Any workaround for calling MATLAB from python via GitHub Actions? I tried starting a MATLAB instance before calling the Python code, but no avail.

@mcafaro
Copy link
Member

mcafaro commented Jan 9, 2025

Hi @skjerns,

Using a self-hosted runner that has a traditionally licensed MATLAB is still the best workaround available. A batch token cannot be used to run a MATLAB Engine.

-Mark

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants