Why is Matlab 2019B not using python 3.6?

8 Ansichten (letzte 30 Tage)
Brian Barry
Brian Barry am 19 Jul. 2020
Kommentiert: the cyclist am 20 Jul. 2020
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.

Antworten (1)

the cyclist
the cyclist am 19 Jul. 2020
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 Kommentare
Brian Barry
Brian Barry am 20 Jul. 2020
This is what I have been attempting to begin with, however the library path is still empty. Weird.
the cyclist
the cyclist am 20 Jul. 2020
That is weird. You could try contacting Mathworks support and see if they can help out.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Call Python from MATLAB finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by