Why is Matlab 2019B not using python 3.6?
4 次查看(过去 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!