Fail to install Matlab R2021b in Python 3.8/3.9 - setuptools error 'PEP 440'

23 次查看(过去 30 天)
Hello there,
I have been using MATLAB-Python connection for a while now with older Python versions and Matlab releases. However, recently in my environment with Python 3.9 I found an error to install MATLAB R2021b (only MATLAB version compatible with Python 3.9).
The error occurs when I run the setup.py file in extern/engines/python/dist see the error message below:
UserWarning: The version specified ('R2021b') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.
warnings.warn(
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: no commands supplied
I believe it relates with the version numering of MATLAB being not valid for PEP 440. I checked by setuptools version and it is 60.2.0.
PS: I also tried to install R2021b in a newly created environment with Python 3.8 and setup tools 60.5.0 but got the same error.
Is there any solution to this error, or a way to avoid this version numbering check?
Thank you.

采纳的回答

r_avelino
r_avelino 2022-1-19
The error goes away if the keyword ``install`` is used
python setup.py install
  6 个评论
Vinay Kulkarni
Vinay Kulkarni 2023-10-9
I am using virtual environment using conda with python python version 3.19.18 . As per the document it should support the version.
Randall Pittman
Randall Pittman 2024-4-11
Edit matlabroot/extern/engines/python/setup.py. At the end of the file in the setup() call, change the version= argument to the numeric version found in matlabroot/VersionInfo.xml.
This has been fixed in later versions of MATLAB (setup.py now has a PEP 440-compatible version number)

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by