install matlabengine error: subprocess-exited-with-error
149 views (last 30 days)
Show older comments
>pip install matlabengine
Collecting matlabengine
Using cached matlabengine-9.15.2.tar.gz (18 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: matlabengine
Building wheel for matlabengine (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for matlabengine (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [56 lines of output]
running bdist_wheel
running build
running build_py
_get_engine_ver_major_minor returned: ('9', '15')
_get_engine_ver_major_minor returned: ('9', '15')
Traceback (most recent call last):
File "C:\Users\guentner\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
main()
File "C:\Users\guentner\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\guentner\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 251, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\guentner\AppData\Local\Temp\pip-build-env-5xd8bphw\overlay\Lib\site-packages\setuptools\build_meta.py", line 434, in build_wheel
return self._build_with_temp_dir(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\guentner\AppData\Local\Temp\pip-build-env-5xd8bphw\overlay\Lib\site-packages\setuptools\build_meta.py", line 419, in _build_with_temp_dir
self.run_setup()
File "C:\Users\guentner\AppData\Local\Temp\pip-build-env-5xd8bphw\overlay\Lib\site-packages\setuptools\build_meta.py", line 341, in run_setup
exec(code, locals())
File "<string>", line 415, in <module>
File "C:\Users\guentner\AppData\Local\Temp\pip-build-env-5xd8bphw\overlay\Lib\site-packages\setuptools\__init__.py", line 103, in setup
return distutils.core.setup(**attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\guentner\AppData\Local\Temp\pip-build-env-5xd8bphw\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
return run_commands(dist)
^^^^^^^^^^^^^^^^^^
File "C:\Users\guentner\AppData\Local\Temp\pip-build-env-5xd8bphw\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
dist.run_commands()
File "C:\Users\guentner\AppData\Local\Temp\pip-build-env-5xd8bphw\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
self.run_command(cmd)
File "C:\Users\guentner\AppData\Local\Temp\pip-build-env-5xd8bphw\overlay\Lib\site-packages\setuptools\dist.py", line 989, in run_command
super().run_command(command)
File "C:\Users\guentner\AppData\Local\Temp\pip-build-env-5xd8bphw\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\guentner\AppData\Local\Temp\pip-build-env-5xd8bphw\overlay\Lib\site-packages\wheel\bdist_wheel.py", line 364, in run
self.run_command("build")
File "C:\Users\guentner\AppData\Local\Temp\pip-build-env-5xd8bphw\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\guentner\AppData\Local\Temp\pip-build-env-5xd8bphw\overlay\Lib\site-packages\setuptools\dist.py", line 989, in run_command
super().run_command(command)
File "C:\Users\guentner\AppData\Local\Temp\pip-build-env-5xd8bphw\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\guentner\AppData\Local\Temp\pip-build-env-5xd8bphw\overlay\Lib\site-packages\setuptools\_distutils\command\build.py", line 131, in run
self.run_command(cmd_name)
File "C:\Users\guentner\AppData\Local\Temp\pip-build-env-5xd8bphw\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\guentner\AppData\Local\Temp\pip-build-env-5xd8bphw\overlay\Lib\site-packages\setuptools\dist.py", line 989, in run_command
super().run_command(command)
File "C:\Users\guentner\AppData\Local\Temp\pip-build-env-5xd8bphw\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "<string>", line 381, in run
File "<string>", line 217, in get_matlab_root_from_windows_reg
File "<string>", line 260, in _find_matlab_key_from_windows_registry
RuntimeError: No compatible MATLAB installation found in Windows Registry. This release of MATLAB Engine API for Python is compatible with version 9.15. The found versions were 9.14.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for matlabengine
Failed to build matlabengine
ERROR: Could not build wheels for matlabengine, which is required to install pyproject.toml-based projects
maybe someone have fix for this?
1 Comment
Harald
on 22 Sep 2023
Hi,
far down the error stack, it tells the underlying problem:
This release of MATLAB Engine API for Python is compatible with version 9.15. The found versions were 9.14.
Best wishes,
Harald
Accepted Answer
Shivani
on 16 Oct 2023
It is likely you are facing this error because the version of MATLAB you are using is not compatible with the version of "matlabengine" you are trying to install.
Since the stack mentions that version 9.14 is available, I am assuming you are currently working with MATLAB 2023a. The "matlabengine" release you are trying to install is version 19.5 which requires MATLAB 2023b.
To install the 9.14 version, you can run the command below:
pip install matlabengine==9.14.2
You can visit this link for more information about the releases and the corresponding versions of MATLAB they require:
Additionally, you can look at the requirements for 9.15 version by accessing this link: https://pypi.org/project/matlabengine/9.15.2/#:~:text=from%20Python%20code.-,Requirements,-Required%20MathWorks%20Products
Please refer to the following documentation for more information about installing "matlabengine” API for Python:
- https://www.mathworks.com/help/matlab/matlab_external/install-the-matlab-engine-for-python.html
- https://pypi.org/project/matlabengine/
Hope this resolves your issue!
0 Comments
More Answers (0)
See Also
Categories
Find more on Introduction to Installation and Licensing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!