arokem / python-matlab-bridge

A simple Python => MATLAB(R) interface and a matlab_magic for ipython
BSD 2-Clause "Simplified" License
332 stars 97 forks source link

ValueError: MATLAB failed to start on Mac #233

Open jaschwer opened 8 years ago

jaschwer commented 8 years ago

Hey, I run your code from pymatbridge import Matlab mlab = Matlab() and then I want to start matlab using mlab.start() I get following problem: Starting MATLAB on ZMQ socket ipc:///tmp/pymatbridge-94df9da7-4b0a-4b45-91b4-c3364735f612 Send 'exit' command to kill the server ............................................................MATLAB session timed out after 60 seconds


ValueError Traceback (most recent call last)

in () ----> 1 mlab.start() /Applications/anaconda/lib/python2.7/site-packages/pymatbridge/pymatbridge.pyc in start(self) 223 return self 224 else: --> 225 raise ValueError("%s failed to start" % self._program_name()) 226 227 def _response(self, **kwargs): ValueError: MATLAB failed to start If I run the command ~/Applications/MATLAB_R2014b/bin/matlab the terminal tells me that there is no such file. How can I solve this problem?
arokem commented 8 years ago

Excuse the naive question: do you have Matlab installed? Where is it installed. Also -- what operating system are you running this on?

If you are on a mac with Matlab 2014b installed (it appears like you might be), what happens when you type the following in the terminal?

/Applications/MATLAB_R2014b/bin/matlab

(without the leading tilde)

On Fri, Mar 25, 2016 at 9:14 AM, Jakob Schwerter notifications@github.com wrote:

Hey, I run your code from pymatbridge import Matlab mlab = Matlab() and then I want to start matlab using mlab.start() I get following problem: Starting MATLAB on ZMQ socket ipc:///tmp/pymatbridge-94df9da7-4b0a-4b45-91b4-c3364735f612 Send 'exit' command to kill the server ............................................................MATLAB session

timed out after 60 seconds

ValueError Traceback (most recent call last) in () ----> 1 mlab.start()

/Applications/anaconda/lib/python2.7/site-packages/pymatbridge/pymatbridge.pyc in start(self) 223 return self 224 else: --> 225 raise ValueError("%s failed to start" % self._program_name()) 226 227 def _response(self, **kwargs):

ValueError: MATLAB failed to start

If I run the command ~/Applications/MATLAB_R2014b/bin/matlab the terminal tells me that there is no such file. How can I solve this problem?

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/arokem/python-matlab-bridge/issues/233

jaschwer commented 8 years ago

Sure, I have it installed and I can open it manually (just checked it again). I am running Yosemite, and usually matlab needs a very long time to start. So maybe there is a problem with those 60 seconds?

Just typing
/Applications/MATLAB_R2014b/bin/matlab into the terminal gives me the same as with the tilde. If I just type /Applications I get the answer that it is a directory.

arokem commented 8 years ago

Where is Matlab installed on your machine? (e.g., "/Applications/MATLAB_R2014b")?

When you say "gives me the same as with the tilde", what exactly do you mean? What is the error message you see?

On Fri, Mar 25, 2016 at 9:35 AM, Jakob Schwerter notifications@github.com wrote:

Sure, I have it installed and I can open it manually (just checked it again). I am running Yosemite, and usually matlab needs a very long time to start. So maybe there is a problem with those 60 seconds?

Just typing

/Applications/MATLAB_R2014b/bin/matlab into the terminal gives me the same as with the tilde. If I just type /Applications I get the answer that it is a directory.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/arokem/python-matlab-bridge/issues/233#issuecomment-201355602

jaschwer commented 8 years ago

After typing /Applications/MATLAB_R2014b/bin/matlab and ~/Applications/MATLAB_R2014b/bin/matlab I get the same error: -bash: /Applications/MATLAB_R2014b/bin/matlab: No such file or directory and -bash: /Users/jakobschwerter/Applications/MATLAB_R2014b/bin/matlab: No such file or directory

It is installed at "/Programme/MATLAB_R2014b", but using "Programme" did not worked neither and I dont even find the directory "/Programme" so that's why I continued with "/Applications". I found in another Issue of your's that one user just had to include some PATH, but I don't know what he actually did.

arokem commented 8 years ago

You need to to find the Matlab binary that when called from the terminal starts Matlab. It's typically in a folder such as /Applications/MATLAB_R2014b/bin/matlab, but you'll have to find where exactly it is on your machine.

jaschwer commented 8 years ago

I can open matlab witht the following lines: /Applications/MATLAB_R2016a.app/bin/matlab Applications/MATLAB_R2016a.app/Contents/MacOS/StartMatlab

but not without the ".app"

arokem commented 8 years ago

Great! Does everything work for you now? I think you should pass the first of these strings (...bin/matlab) as the executable key-word argument to the Matlab object.

jaschwer commented 8 years ago

Unfortunately not, sorry. I used mlab = Matlab(executable='/Applications/MATLAB_R2016a.app/bin/matlab') mlab.start() and in the backgroup it opens matlab (the icon comes up in my dashboard), but I still get following error:

--> 225 raise ValueError("%s failed to start" % self._program_name())

ValueError: MATLAB failed to start

arokem commented 8 years ago

Could you please copy all the output you get?

On Sun, Mar 27, 2016 at 10:40 AM, Jakob Schwerter notifications@github.com wrote:

Unfortunately not, sorry. I used mlab = Matlab(executable='/Applications/MATLAB_R2016a.app/bin/matlab') and in the backgroup it opens matlab (the icon comes up in my dashboard), but if I run the next code mlab.start() I get following error:

--> 225 raise ValueError("%s failed to start" % self._program_name())

ValueError: MATLAB failed to start

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/arokem/python-matlab-bridge/issues/233#issuecomment-202111090

jaschwer commented 8 years ago

Starting MATLAB on ZMQ socket ipc:///tmp/pymatbridge-5920eee4-98fb-451a-ab56-0f25ee198997 Send 'exit' command to kill the server ............................................................MATLAB session timed out after 60 seconds


ValueError Traceback (most recent call last)

in () ----> 1 mlab.start() 2 # Matlab fails to start /Applications/anaconda/lib/python2.7/site-packages/pymatbridge/pymatbridge.pyc in start(self) 223 return self 224 else: --> 225 raise ValueError("%s failed to start" % self._program_name()) 226 227 def _response(self, **kwargs): ValueError: MATLAB failed to start