rsmenon / MATLink

Communicate with MATLAB from Mathematica
matlink.org
68 stars 14 forks source link

Unable to install MATLink in windows10 #109

Closed sbmdkhajamoinuddin closed 3 years ago

sbmdkhajamoinuddin commented 3 years ago

Hai! I couldn't install MATLink in windows 10. Followed the install steps in http://matlink.org/ also tried to follow troubleshooting page but of no use.

  1. Copied MATLink to folder opened by SystemOpen@FileNameJoin[{$UserBaseDirectory, "Applications"}]

  2. The output of Environment["PATH"] is "C:\Program Files\Wolfram \ Research\Mathematica\11.1\SystemFiles\Libraries\Windows-x86-64;C:\ \Program Files\Wolfram \ Research\Mathematica\11.1\SystemFiles\Libraries\Windows;C:\\ Program Files\Wolfram \ Research\Mathematica\11.1\SystemFiles\Kernel\Binaries\Windows-\ x86-64;C:\Program Files\Wolfram \ Research\Mathematica\11.1;C:\Program Files\Wolfram \ Research\Mathematica\11.1\SystemFiles\FrontEnd\Binaries\Windows-\ x86-64;C:\Program Files\Wolfram \ Research\Mathematica\11.1\SystemFiles\Kernel\Binaries\Windows-\ x86-64;C:\Program Files\MATLAB\R2016b\bin"

  3. Ran Matlab as admin and regmatlabserver also worked. (returned empty char array).

  4. Restarted Mathematica several times after adding path

  5. The o/p of Needs["MATLink"] MATLinkDeveloper`GetInfo[]

Get::noopen: Cannot open MATLink. Needs::nocont: Context MATLink was not created when Needs was evaluated. $Failed

  1. Also tried Needs["MATLink`"] SetOptions[MATLink, "Force32BitEngine" -> False] The errors and o/p are

Get::noopen: Cannot open MATLink. Needs::nocont: Context MATLink was not created when Needs was evaluated. $Failed SetOptions::optnf: Force32BitEngine is not a known option for MATLink. SetOptions[MATLink, "Force32BitEngine" -> False]

sbmdkhajamoinuddin commented 3 years ago

My problem resolved! I just took out MATLink.m file out of MATLink folder and pasted separately in the Applications folder and now it's working. May I know what could be the issue?

szhorvat commented 3 years ago

My problem resolved! I just took out MATLink.m file out of MATLink folder and pasted separately in the Applications folder and now it's working.

No, don't do such intrusive modifications (with any package), as this will break things.

May I know what could be the issue?

Very likely, the directory structure was incorrect. You must have $UserBaseDirectory/Applications/MATLink, not $UserBaseDirectory/Applications/MATLink/MATLink.

On Windows, extracting a zip file may or may not create nested directories, depending on what unzipping program you are using. Probably yours created an extra nesting level.

sbmdkhajamoinuddin commented 3 years ago

Yeah! It could be a problem with unzipping program. Thank you szhorvat!

sbmdkhajamoinuddin commented 3 years ago

After changing $UserBaseDirectory/Applications/MATLink/MATLink to $UserBaseDirectory/Applications/MATLink its working now. The problem is merely due to the unzipping program.

szhorvat commented 3 years ago

its working now.

Great! I'm closing this issue then.

The problem is merely due to the unzipping program.

It's not really a problem with the unzipper, but unfortunately programs are a bit inconsistent in how they unzip. Some try to be helpful and create an additional folder with the same name as the zip file. Some do this only when the zip file contained more than a single folder. Some never do it. Thus, unfortunately, it was not possible to package MATLink in a way to get predictable unzipping results.