using PyEnv virtual environment MacOS

18 次查看(过去 30 天)
I manage my Python virtual environments with PyEnv (NOT the Matlab function). I have tried using this with the Matlab interface following the instruction found here: https://uk.mathworks.com/matlabcentral/answers/1750425-python-virtual-environments-with-matlab?requestedDomain=
but it's not working. See below:
>> pe = pyenv('Version', '/Users/myname/.pyenv/versions/analysis/bin/python','ExecutionMode', "OutOfProcess")
pe =
PythonEnvironment with properties:
Version: ""
Executable: ""
Library: ""
Home: ""
Status: NotLoaded
ExecutionMode: OutOfProcess
I'm using R2020a. Any ideas of why this may be? Thanks!
  1 个评论
Adarsh
Adarsh 2025-4-4
Can you please share the python version that you are using and also ensure that you are using the python version compatible to MATLAB, the list of python versions compatible with MATLAB are given in the documentation link below:
Also ensure that you are opening MATLAB from the same terminal where the virtual environment is activated.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Call Python from MATLAB 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by