You can change the environment variable PATHin MATLAB before calling python from MATLAB
% Modify the system PATH so it finds the python executable in your venv first
setenv('PATH', ['/path/to/my/venv/bin', pathsep, getenv('PATH')])
% Call your python script
system('python myscript.py')
Or the best way would be to specify the full path to the python binary
system('/path/to/my/venv/bin/python myscript.py')
Suver source
share