mathworks / MATLAB-extension-for-vscode

This extension provides support for editing MATLAB® code in Visual Studio® Code and includes features such as syntax highlighting, code analysis, navigation support, and more.
https://marketplace.visualstudio.com/items?itemName=MathWorks.language-matlab
MIT License
234 stars 15 forks source link

MATLAB was unable to start #58

Closed denissagaydak closed 3 months ago

denissagaydak commented 1 year ago

Windows 10 21H2 VSCode 1.82.2 MATLAB Extension 1.1.3 MATLAB 2022b

Tried restarting/closing VSCode, MATLAB and restarting PC. Tried installing MATLAB in folder without whitespace. Tried MATLAB 2021b and previous versions of MATLAB Extension;

image

dklilley commented 1 year ago

Can you provide the following info:

  1. Launch MATLAB separately and run matlabroot. Is the value you have provided in the "Install Path" setting the same as what MATLAB is outputting?
  2. Can you confirm that there is no trailing or preceding whitespace in the "Install Path" text field?
  3. In VS Code, open the Output tab (Ctrl+Shift+U) and select "MATLAB Language Server" from the dropdown. Please share any errors displayed in this log.
denissagaydak commented 1 year ago

Hello @dklilley,

  1. matlabroot returns the same path, as specified in "Install Path" setting image
  2. Yes, there are no extra whitespaces in "Install Path" setting image
  3. Here is "MATLAB Language Server" output : (08:58:36) matlabls: Launching MATLAB... [Error - 8:58:36 AM] (08:58:36) matlabls - ERROR: Error launching MATLAB: spawn C:\Program Files\MATLAB\R2022b\bin\matlab ENOENT [Error - 8:58:36 AM] (08:58:36) matlabls - ERROR: Error launching MATLAB: Error [Error - 8:58:36 AM] (08:58:36) matlabls - ERROR: Error launching MATLAB: Error: spawn C:\Program Files\MATLAB\R2022b\bin\matlab ENOENT at ChildProcess._handle.onexit (node:internal/child_process:283:19) at onErrorNT (node:internal/child_process:476:16) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) (08:58:36) matlabls: MATLAB process terminated
M-Moschetti commented 8 months ago

Same issue.

Windows 10.0.19045 22H2 VS Code 1.85.1 VS Code MATLAB extension v1.1.5 MATLAB 2023b

Steps taken:

MATLAB Language Server output:

(13:17:04) matlabls: Log Directory: C:\Users\z5165928\AppData\Local\Temp\matlabls_1052 (13:17:04) matlabls: Launching MATLAB... [Error - 1:17:04 PM] (13:17:04) matlabls - ERROR: Error finding mlint executable in C:\Program Files\MATLAB\R2023b\bin [Error - 1:17:04 PM] (13:17:04) matlabls - ERROR: Error launching MATLAB: spawn C:\Program Files\MATLAB\R2023b\bin\matlab ENOENT [Error - 1:17:04 PM] (13:17:04) matlabls - ERROR: Error launching MATLAB: Error [Error - 1:17:04 PM] (13:17:04) matlabls - ERROR: Error launching MATLAB: Error: spawn C:\Program Files\MATLAB\R2023b\bin\matlab ENOENT at ChildProcess._handle.onexit (node:internal/child_process:283:19) at onErrorNT (node:internal/child_process:476:16) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) (13:17:04) matlabls: MATLAB process terminated

dklilley commented 8 months ago

Thanks for reporting this. I have not been able to reproduce this on my machine, but here are a few things to try/check:

  1. Is there any leading/trailing whitespace in the installPath setting's text field in VS Code? This probably isn't the issue, but has been known to cause problems.
  2. From a system command window, does running the following (including the double quotes) launch MATLAB correctly? "C:\Program Files\MATLAB\R2023b\bin\matlab.exe"
  3. Does running matlab from a system command window launch MATLAB? On Windows, the extension will attempt to launch MATLAB with the matlab command if no path is provided in the setting. If this command works on your machine, try clearing the installPath setting.
M-Moschetti commented 8 months ago

I can confirm that there are no leading/trailing white spaces.

Both options 2. and 3. successfully launch MATLAB. Clearing the InstallPath settings changed nothing.

Thanks for your help.

dklilley commented 8 months ago

One more quick question - Are you running VS Code from the Windows Subsystem for Linux (WSL)?

M-Moschetti commented 8 months ago

No, I am not.

On Sat, 13 Jan 2024, 1:52 am Duncan Lilley, @.***> wrote:

One more quick question - Are you running VS Code from the Windows Subsystem for Linux (WSL)?

— Reply to this email directly, view it on GitHub https://github.com/mathworks/MATLAB-extension-for-vscode/issues/58#issuecomment-1889419932, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARXTSSGCJAXYS4DRD73A6F3YOFE2RAVCNFSM6AAAAAA46CVIMOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBZGQYTSOJTGI . You are receiving this because you commented.Message ID: @.***>

MiuKaShi commented 8 months ago

Same problem in MATLAB-language-server, https://github.com/mathworks/MATLAB-language-server/issues/33. So May cause by MATLAB-language-server ?

dklilley commented 6 months ago

Hi all, If you have a chance, can you try this again with the new release of the extension (v1.2.1) and let us know if you are still encountering this issue?

M-Moschetti commented 6 months ago

I no longer have access to the offending machine, so I cannot test this. My apologies.

On Fri, Apr 5, 2024 at 4:27 AM Duncan Lilley @.***> wrote:

Hi all, If you have a chance, can you try this again with the new release of the extension (v1.2.1) and let us know if you are still encountering this issue?

— Reply to this email directly, view it on GitHub https://github.com/mathworks/MATLAB-extension-for-vscode/issues/58#issuecomment-2037785746, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARXTSSF5B2S5R7VH6REDN3DY3WEQTAVCNFSM6AAAAAA46CVIMOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZXG44DKNZUGY . You are receiving this because you commented.Message ID: @.***>

dklilley commented 5 months ago

@M-Moschetti no worries, thank you for the response!

dklilley commented 3 months ago

I believe this is likely resolved. Closing this issue for now.

sbom641 commented 2 months ago

I am experiencing the same problem VS code - 1.91.1 MATLAB - 2023b Matlab Extension for VS Code - v1.2.4 Windows - 11Pro 23H2

image

image

This is the only error message I keep getting: image (I do not get/see any errros outputed to the OUTPUT tab in VS Code)

Edit 1: Running matlab from the system command window succesfully does launch Matlab

Any help is appreciated.

dklilley commented 2 months ago

Hi @sbom641 , since this issue is closed, can you open a new issue for this? Thanks!