using PyEnv virtual environment MacOS
18 views (last 30 days)
Show older comments
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 Comment
Adarsh
on 4 Apr 2025
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.
Answers (0)
See Also
Categories
Find more on Call Python from MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!