As it is matlabengine detects matlab installation path in the setup.py at installation time by checking paths in LD_LIBRARY_PATH.
This requires:
LD_LIBRARY_PATH to be defined
- The installation process to be held in the same environment as it will used
Why not also using shutil.which to probe for the installation path of matlab rather than only relying on LD_LIBRARY_PATH?
What about moving this probing from setup.py (which goal is to produce the _arch.txt file) to matlab/__init__.py where this information is actually used? This would allow to make wheels and be resilient to changes in the path matlab is installed.
As it is
matlabenginedetectsmatlabinstallation path in thesetup.pyat installation time by checking paths inLD_LIBRARY_PATH.This requires:
LD_LIBRARY_PATHto be definedWhy not also using
shutil.whichto probe for the installation path of matlab rather than only relying onLD_LIBRARY_PATH?What about moving this probing from
setup.py(which goal is to produce the_arch.txtfile) tomatlab/__init__.pywhere this information is actually used? This would allow to make wheels and be resilient to changes in the path matlab is installed.