MATLAB: Is the installation of the MATLAB Engine API for Python failing

MATLAB

I'm trying to install MATLAB Engine API for Python with:
D:\>python "C:\Program Files\MATLAB\R2017b\extern\engines\python\setup.py" install 
But it is failing with the following error:
running install 
running build 
running build_py 
error: package directory 'dist\matlab' does not exist

Best Answer

Change directory into matlabroot/extern/engines/python and start "python setup.py install" there.
As noted in the <https://www.mathworks.com/help/matlab/matlab_external/install-the-matlab-engine-for-python.html installation instructions>, "python setup.py install" must be started inside the directory of setup.py. Starting from other locations will result in an error.
By default, the installer builds the engine API for Python in the matlabroot\extern\engines\python folder. The installer installs the engine in the default Python folder. To use non-default folders, refer to: