Azzera filtri
Azzera filtri

Issue Installing MATLAB Engine API for Python in Python 3.8 Environment

22 visualizzazioni (ultimi 30 giorni)
I'm trying to install the MATLAB Engine API for Python on my windows (64) machine, but I've encountered an error during the installation process. I'm using MATLAB R2022a, tried Python 3.8/3.7/3.7.
The error message I'm receiving is: "setuptools.extern.packaging.version.InvalidVersion: Invalid version: 'R2022a'"
I would greatly appreciate any advice or recommendations you can offer on this issue. Here are the steps I've followed so far:
  1. Activated conda python environment (in pycharm)
  2. Navigated to the MATLAB Engine API directory (D:\matlab\install\extern\engines\python).
  3. Ran python install to install the MATLAB Engine API.
  4. I also attempted to modify the code in "version="R2022a" as "version="0.2022a", still get the same error.
Please let me know if there's any other information I can provide to assist in troubleshooting this issue.
Thank you in advance for your help!

Risposte (1)

Yoga il 2 Ago 2023
The issue seems to occur when you try to install the python package generated from MATLAB in Anaconda based virtual environments. The generated package works completely fine inside virtual environments created through methods other than conda like "pip". It is not guaranteed that the library compiler generated code will install fine inside Conda based virtual environments.
However, it is recommended to use the "py" command instead of the "python" command inside the Conda virtual environment terminal to make it work if you have some Python installation other than Anaconda in the computer.
"py" command:
py install
The "py" command python launcher which is a utility that comes with Python installations on Windows. It gets installed into "C:\Windows\" so it’s available without requiring path modifications.


Scopri di più su Python Package Integration in Help Center e File Exchange




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by