Effacer les filtres
Effacer les filtres

Issue Installing MATLAB Engine API for Python in Python 3.8 Environment

12 vues (au cours des 30 derniers jours)
Jinding Xing
Jinding Xing le 9 Juin 2023
Réponse apportée : Yoga le 2 Août 2023
Hello,
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 setup.py install to install the MATLAB Engine API.
  4. I also attempted to modify the code in setup.py "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!

Réponses (1)

Yoga
Yoga le 2 Août 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 setup.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.

Catégories

En savoir plus sur Python Package Integration dans Help Center et File Exchange

Produits


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by