Skip to content

Commit a9a12fe

Browse files
HanSur94claude
andcommitted
fix: MATLAB Engine access denied + missing tomli/taskgroup for py3.10
1. MATLAB Engine build failed with "Zugriff verweigert" (access denied) because pip tried to create build/ inside C:\Program Files\MATLAB which is read-only. Now copies the source to %TEMP% before building. 2. Added tomli (needed by cyclopts on Python <3.11, since tomllib is only in stdlib from 3.11+) and taskgroup (needed by anyio on <3.11). These conditional deps weren't captured when downloading from py3.11. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 58e7bf3 commit a9a12fe

4 files changed

Lines changed: 18 additions & 2 deletions

File tree

install.bat

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,20 @@ python -c "import matlab.engine" >nul 2>&1
244244
if %errorlevel% equ 0 (
245245
echo MATLAB Engine API already installed. Skipping.
246246
) else (
247-
echo Installing from !ENGINE_API_DIR! (offline, no download needed^)...
248-
pip install "!ENGINE_API_DIR!" --no-build-isolation --quiet 2>&1
247+
:: Copy MATLAB Engine source to a temp dir because pip tries to create
248+
:: a build/ folder in the source directory, which fails with "Access denied"
249+
:: when the source is in C:\Program Files (read-only without admin).
250+
set "ENGINE_TEMP=%TEMP%\matlab_engine_build"
251+
if exist "!ENGINE_TEMP!" rd /s /q "!ENGINE_TEMP!" >nul 2>&1
252+
echo Copying MATLAB Engine source to writable temp directory...
253+
xcopy "!ENGINE_API_DIR!" "!ENGINE_TEMP!" /E /I /Q /Y >nul 2>&1
254+
if %errorlevel% neq 0 (
255+
echo [WARNING] Could not copy MATLAB Engine source files.
256+
echo Continuing with MCP server installation...
257+
goto :install_mcp
258+
)
259+
echo Installing from temp copy (offline, no download needed^)...
260+
pip install "!ENGINE_TEMP!" --no-build-isolation --quiet 2>&1
249261
if %errorlevel% neq 0 (
250262
echo.
251263
echo [WARNING] MATLAB Engine API installation failed.
@@ -260,6 +272,8 @@ if %errorlevel% equ 0 (
260272
) else (
261273
echo [OK] MATLAB Engine API installed.
262274
)
275+
:: Clean up temp copy
276+
rd /s /q "!ENGINE_TEMP!" >nul 2>&1
263277
)
264278
echo.
265279

requirements-lock.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ shellingham==1.5.4
7575
sortedcontainers==2.4.0
7676
sse-starlette==3.3.3
7777
starlette==0.52.1
78+
taskgroup==0.2.2
79+
tomli==2.4.0
7880
typer==0.24.1
7981
typing-inspection==0.4.2
8082
typing_extensions==4.15.0
13.9 KB
Binary file not shown.
14.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)