Why is Matlab 2019B not using python 3.6?
3 ビュー (過去 30 日間)
古いコメントを表示
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.
0 件のコメント
回答 (1 件)
the cyclist
2020 年 7 月 19 日
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 件のコメント
the cyclist
2020 年 7 月 20 日
That is weird. You could try contacting Mathworks support and see if they can help out.
参考
カテゴリ
Help Center および File Exchange で Call Python from MATLAB についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!