After installing matlab and matlabengine (proof of the pip install in the picture)
I get the following error:
Exception has occurred: ModuleNotFoundError
No module named 'matlab.engine'; 'matlab' is not a package
AttributeError: module 'matlab' has no attribute '__path__'
I have shared the engine on my MATLAB 2023a version and it’s active. I also added both the python3.10 version and MATLAB version to the environment variables path.
I installed matlab through the download software they provide, and there was no problem regarding installation. My operating system is Windows 11. I uninstalled all python versions and only kept 3.10 as to avoid any error of wrong version, however this uninstalls the pip too right? (just making sure). I followed these commands:
cd "C:\Program Files\MATLAB\R2023a\extern\engines\python"
python setup.py install
pip install matlabengine
Then, in the IDE:
import matlab.engine (it will not recognise matlab.engine)
eng = matlab.engine.connect_matlab(background=True)
After using python -m pip install matlabengine
(I checked the official MATLAB page and the MATLAB as well as the python version I have are compatible):