Why is Matlab 2019B not using python 3.6?

3 visualizaciones (últimos 30 días)
Brian Barry
Brian Barry el 19 de Jul. de 2020
Comentada: the cyclist el 20 de Jul. de 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.

Respuestas (1)

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

Iniciar sesión para comentar.

Categorías

Más información sobre Call Python from MATLAB en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by