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

Failed to open a MATLAB engine session on Windows #167

Open
wangjie212 opened this issue Feb 5, 2020 · 6 comments
Open

Failed to open a MATLAB engine session on Windows #167

wangjie212 opened this issue Feb 5, 2020 · 6 comments

Comments

@wangjie212
Copy link

Hello,

When calling MSession(), I get the following error on Windows:
ERROR: MEngineError("Failed to open a MATLAB engine session")
in MSession at MATLAB\cVrxc\src\engine.jl:23.

I'm using Matlab R2019b 64 bits. I can start Matlab normally.
I have set the env variable MATLAB_HOME and runned matlab -regserver in a Command Prompt as Administrator.

Anyone knows how to fix this?

@musm
Copy link
Collaborator

musm commented Feb 5, 2020

which julia version and platform?

@wangjie212
Copy link
Author

Julia 1.2.0 Windows10

@ronubi
Copy link

ronubi commented Feb 7, 2020

Without explicitly calling MSession, can you just do

mat"ver"

to see if Julia will connect to the Matlab engine?

@wangjie212
Copy link
Author

Without explicitly calling MSession, can you just do

mat"ver"

to see if Julia will connect to the Matlab engine?

It reports the error:
MEngineError("failed to open MATLAB engine session")

@musm
Copy link
Collaborator

musm commented Feb 10, 2020

very odd.

@jacob-roth
Copy link

jacob-roth commented Oct 19, 2023

I had to do the following (which is manually/hardcoded for R2020b)

  1. clone my version https://github.com/jacob-roth/MATLAB.jl.git
  2. add push!(LOAD_PATH,"C:\\Users\\roth0674\\git\\MATLAB.jl") to AppData/Local/Programs/Julia-1.x.x/etc/julia/startup.jl and open REPL
  3. from REPL, set ENV["MATLAB_ROOT"] = "C:\Program Files\MATLAB\R2020b\" (you will have to move it to this location if you dont want to edit my fork)
  4. ] add "C:\path\to\cloned\MATLAB.jl"
  5. ] build MATLAB
  6. using MATLAB

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