unable to resolve the name py.function error

Hello,
I am trying to call python in Matlab on Mac machine but i am not able to run any kind of (py.blabla) command, it says 'Unable to resolve the name py.myfunction'.
I used the command pyenv('Version' , 'Location of python') to load the python in Matlab.
And when i enter pyenv command the status says NotLoaded, please look at the screenshot in attachment.
kindly help me resolve the Issue.
Thanks & Regards,
Muneeb Fida

답변 (1개)

Al Danial
Al Danial 2022년 5월 19일

1 개 추천

Couple of things to try:
1) change the execution mode to InProcess
>> pyenv('ExecutionMode', 'InProcess')
2) open a terminal and verify that the Python installation you're pointing to works
$ /opt/miniconda3/bin/python
>>> print(3+4)
>>> exit()
Which version of matlab is this?

댓글 수: 3

So i located to the folder where the python is and tried to run the Python, it works there. The screenshot also shows this, please take a look. And i also already tried with InProcess Mode still doesnot work
Its 2022a Version
I'm at a loss and have only one more suggestion: if practical, install a full Anaconda distribution instead of the minimal miniconda. That's what I have on my mac and it works well.

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

카테고리

도움말 센터File Exchange에서 Call Python from MATLAB에 대해 자세히 알아보기

질문:

2022년 5월 15일

댓글:

2022년 5월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by