File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -197,8 +197,20 @@ function initialize_python_integration(env_name, logger)
197197 python_path = strip(python_path );
198198 logger .info(' Found Python executable: %s ' , python_path );
199199
200- % Set MATLAB's Python environment to use this executable
201- pyenv(' Version' , python_path );
200+ % Add Python directory to system PATH (like the working Unix tests)
201+ python_dir = fileparts(python_path );
202+ current_path = getenv(' PATH' );
203+ if isunix
204+ new_path = [python_dir ' :' current_path ];
205+ else
206+ new_path = [python_dir ' ;' current_path ];
207+ end
208+ setenv(' PATH' , new_path );
209+ logger .info(' Added Python directory to PATH: %s ' , python_dir );
210+
211+ % Set MATLAB's Python environment with OutOfProcess execution mode (like working Unix tests)
212+ pyenv(' Version' , python_path , ' ExecutionMode' , ' OutOfProcess' );
213+ logger .info(' Configured pyenv with OutOfProcess execution mode' );
202214
203215 % Test Python import
204216 logger .info(' Testing Python module imports...' );
You can’t perform that action at this time.
0 commit comments