R2021b python change - Unable to return the number of named arguments if not in an active function.

조회 수: 1 (최근 30일)
In Matlab R2021b, I have problems running my python code. This problem did not exist in R2021a.
I get an error
"Unable to return the number of named arguments if not in an active function. "
I have a class defeinition, with variables and functions, written in python. The actual class connects to an webservice api.
For example I tell matlab to run python, run the api.py file, and create the class object main(). Set the output of this to a variable.
>> pobj = py.api.main()
If I want to retrieve 'data' which is a class variable I use:
>> pobj.data
The above works fine in both R2021a and R2021b.
The problem is if I want to run a class function 'func'
>> pobj.func()
In R2021a this would work.
In R2021b I get the error
"Unable to return the number of named arguments if not in an active function."
Please assist me to find a solution.
  댓글 수: 3
Zouhair Mahboubi
Zouhair Mahboubi 2021년 10월 25일
Having similar issue - this seems to have broken backward compatibility :s
Rory Wheeler
Rory Wheeler 2021년 11월 18일
Thanks to all for feedback and assistance bringing the issue to Mathworks attention.

댓글을 달려면 로그인하십시오.

채택된 답변

Rory Wheeler
Rory Wheeler 2021년 11월 18일
편집: Rory Wheeler 2021년 11월 18일
The issue is now resolved. It was a bug and is fixed by updating to Matlab to "R2021b Update 1".
If interested read the bug report and fix here and R2021b Update 1 release notes here.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Call Python from MATLAB에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by