You can visit to MATLAB official documentation: https://www.mathworks.com/help/matlab/matlab_external/install-the-matlab-engine-for-python.html
I have copied here as well.
Install Python Engine for Multiple MATLAB Versions
You can specify a MATLAB version to run from a Python script by installing the MATLAB Python packages to version-specific locations. For example, suppose that you want to call either MATLAB R2019a or R2019b from a Python version 3.6 script.
From the Windows system prompt, install the R2019a package in a subfolder named matlab19aPy36:
cd "c:\Program Files\MATLAB\R2019a\extern\engines\python"
python setup.py install --prefix="c:\work\matlab19aPy36"
Install the R2019b package in a matlab19bPy36 subfolder:
cd "c:\Program Files\MATLAB\R2019b\extern\engines\python"
python setup.py install --prefix="c:\work\matlab19bPy36"
From a Linux system prompt:
cd "/usr/local/MATLAB/R2019a/bin/matlab/extern/engines/python"
python setup.py install --prefix="/local/work/matlab19aPy36"
cd "/usr/local/MATLAB/R2019b/bin/matlab/extern/engines/python"
python setup.py install --prefix="/local/work/matlab19bPy36"
From a Mac Terminal:
cd "/Applications/MATLAB_R2019a.app/extern/engines/python"
python setup.py install --prefix="/local/work/matlab19aPy36"
cd "/Applications/MATLAB_R2019b.app/extern/engines/python"
python setup.py install --prefix="/local/work/matlab19bPy36"