@@ -187,15 +187,28 @@ function initialize_python_integration(env_name, logger)
187187 % Initialize Python integration
188188 try
189189 % Get the Python executable path from the conda environment
190- [status , python_path ] = mhkit .sys(sprintf(' conda run -n %s python -c "import sys; print(sys.executable)"' , env_name ));
190+ conda_command = sprintf(' conda run -n %s python -c "import sys; print(sys.executable)"' , env_name );
191+ logger .info(' Executing command: %s ' , conda_command );
192+ [status , python_path ] = mhkit .sys(conda_command );
193+
194+ logger .info(' Command status: %d ' , status );
195+ logger .info(' Raw Python path output: "%s "' , python_path );
191196
192197 if status ~= 0
193198 logger .error(' Failed to get Python executable path from conda environment' );
199+ logger .error(' Command output: %s ' , python_path );
194200 return
195201 end
196202
197203 python_path = strip(python_path );
198- logger .info(' Found Python executable: %s ' , python_path );
204+ logger .info(' Cleaned Python executable: %s ' , python_path );
205+
206+ % Verify the Python executable exists
207+ if ~exist(python_path , ' file' )
208+ logger .error(' Python executable does not exist at path: %s ' , python_path );
209+ return
210+ end
211+ logger .info(' ✓ Verified Python executable exists' );
199212
200213 % Add Python directory to system PATH (like the working Unix tests)
201214 python_dir = fileparts(python_path );
0 commit comments