how do I let matlab use a specific python3 version?
조회 수: 4 (최근 30일)
이전 댓글 표시
I am running Ubuntu 18 and Matlab R2022b. My Ubuntu does not like to have a different default python3 than python3.6 (it then gives all kind of weird errors like not being able to start a terminal). Matlab R2022b does not support python3.6. I have python3.8 installed via deadsnakes/sudo apt-get install python3.8 and it works fine in the terminal (/usr/bin/python3.8). When I set this in Matlab via pyversion('/usr/bin/python3.8') it does not work. Any hints?
when I run pyversion I get:
pyversion
version: '3.8'
executable: '/usr/bin/python3.8'
library: ''
home: '/usr'
isloaded: 0
so library remains empty.
then when I run:
py.list({'This','is a','list'})
Unable to resolve the name 'py.list'.
Running pyversion('/usr/bin/python3') obviously gives the error 'Python version 3.6 is not supported.'
Running pyversion('/usr/bin/python2.7') results in a working environment:
pyversion
version: '2.7'
executable: '/usr/bin/python2.7'
library: 'libpython2.7.so.1.0'
home: '/usr'
isloaded: 0
but I need python3 instead! Any help?
댓글 수: 0
채택된 답변
추가 답변 (0개)
참고 항목
카테고리
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!