Why is Matlab 2019B not using python 3.6?

조회 수: 3 (최근 30일)
Brian Barry
Brian Barry 2020년 7월 19일
댓글: the cyclist 2020년 7월 20일
I am attempting to use a Matlab wrapper for a Python library, one that requires >= Python 3.5. When I use the `pyenv` command for Python 2, it shows something like this, with a library path
Version: "2.7"
Executable: "/usr/bin/python2.7"
Library: "library path"
Home: "/usr"
...
But when I use the same command after "loading" Python 3.6, the library path is empty. As a result, python is not actually loaded, so any py command (e.g. `py.list`) returns an error in the form `unable to resolve the name py.commandname`. If I check my terminal shell, I know that I have this version installed however. Also it is in --enable -shared upon calling RPM.
I feel like I've reached a dead end at this point, and due to the configuration of the computer I am working on, a solution without using anaconda would be preferable.

답변 (1개)

the cyclist
the cyclist 2020년 7월 19일
The following worked for me, per instructions in the documentation for pyenv.
First, I ran
pyenv
with no argument, which told me 2.7 was loaded. Then I ran
py.list
just to verify that it worked.
Then, I restarted MATLAB, which according to the first note on that page is required to change the interpreter.
Then I ran
pyenv('Version','/usr/local/bin/python3')
using the full path to the executable on my machine. (Your path may differ. I found it by typing "which python3" in a Mac terminal.)
I hope that helps.
  댓글 수: 2
Brian Barry
Brian Barry 2020년 7월 20일
This is what I have been attempting to begin with, however the library path is still empty. Weird.
the cyclist
the cyclist 2020년 7월 20일
That is weird. You could try contacting Mathworks support and see if they can help out.

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

카테고리

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

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by