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

MATLABPyHost.exe won't start on Windows #26

Open
H0R5E opened this issue Feb 7, 2022 · 1 comment
Open

MATLABPyHost.exe won't start on Windows #26

H0R5E opened this issue Feb 7, 2022 · 1 comment
Assignees

Comments

@H0R5E
Copy link

H0R5E commented Feb 7, 2022

Hi,

I've been trying to get MATLAB's 'OutOfProcess' Python support to work on a Windows runner, but I've encountered an issue that I can't get past. This is my workflow:

name: MATLAB Windows OutOfProcess Bug

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  main:
    runs-on: 'windows-latest'
    steps:
      - name: Set up MATLAB
        uses: matlab-actions/setup-matlab@v1
      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: '3.8'
      - name: Create MATLAB script
        run: |
          "pyenv('ExecutionMode', 'OutOfProcess')" | Out-File -FilePath run.m
          "py.list({'Monday','Tuesday','Wednesday','Thursday','Friday'})" | Out-File -FilePath run.m -Append
      - name: Run script
        run: matlab -batch "run"

The output from the last step is:

MATLAB is running in headless mode.  Figure windows will not be displayed.

	Sponsored License -- for use in support of a program or activity sponsored by MathWorks.
	Not for government, commercial or other non-sponsored organizational use.

Caught "std::exception" Exception message is:
Unable to launch Simple server: Unable to launch C:\Program Files\MATLAB\R2021b\interprocess\bin\win64\pycli\MATLABPyHost.exe

because: An error occurred while initializing child process:  While attempting to execute "C:\Program Files\MATLAB\R2021b\interprocess\bin\win64\pycli\MATLABPyHost.exe -mvmInputPipe 138736 0 0 0 0 0 -mvmOutputPipe 0 139588 0 0 0 0": CreateProcessW: The parameter is incorrect

ans = 

  PythonEnvironment with properties:

          Version: "3.8"
       Executable: "C:\hostedtoolcache\windows\Python\3.8.[10](https://github.com/H0R5E/matlab-actions-windows-bug/runs/5096231061#step:5:10)\x64\python.EXE"
          Library: "C:\hostedtoolcache\windows\Python\3.8.10\x64\python38.dll"
             Home: "C:\hostedtoolcache\windows\Python\3.8.10\x64"
           Status: NotLoaded
    ExecutionMode: OutOfProcess

thread_monitor::launch: _beginthreadex failed
ERROR: MATLAB error Exit Status: 0x00000001
Error: Process completed with exit code 1.

I have set up a repo just to test this issue and you can see the outcome here.

I understand that Windows support is not official, as yet, but can you offer me any advice about this issue?

Many thanks,

Mat

@mcafaro
Copy link
Member

mcafaro commented Feb 16, 2022

Hi Mat,

I am still investigating this issue. It does not occur locally, so it must be something unique about the way Python is installed on these agents or something unique about the agent configuration in general. I will update this issue with progress.

Best,
Mark

@mcafaro mcafaro self-assigned this Feb 16, 2022
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

2 participants