我用迷你锻造在我的苹果M1上安装了Python
brew install --cask miniforge 但我无法在MATLAB上使用Conda环境:
>> pyenv('Version', '/opt/homebrew/Caskroom/miniforge/base/envs/matpy39/bin/python3')
ans =
PythonEnvironment with properties:
Version: "3.9"
Executable: "/opt/homebrew/Caskroom/miniforge/base/envs/matpy39/bin/python3"
Library: "/opt/homebrew/Caskroom/miniforge/base/envs/matpy39/lib/libpython3.9.dylib"
Home: "/opt/homebrew/Caskroom/miniforge/base/envs/matpy39"
Status: NotLoaded
ExecutionMode: InProcess
>> py.list({1})
Unable to resolve the name py.list.但是,如果我使用在python版本中构建的Mac,它确实可以工作:
>> pyversion('/usr/bin/python3')
>> py.list({1})
ans =
Python list with no properties.
[1.0]我不知道该怎么做,以便MATLAB使用特定的Conda环境。
发布于 2021-12-10 16:25:48
现在,自制软件在苹果硅上构建了本机ARM/M1二进制文件。Matlab是一个运行在罗塞塔仿真环境下的x64二进制程序。我怀疑问题在于您无法将ARM库(自制的Python)加载到x64/Rosetta进程(Matlab)中。我敢打赌macOS的系统Python发行版是一个“通用”构建或类似的东西,可以加载到任何一种进程中。
您可能可以通过安装x64版本的Miniforge或Anaconda在家庭酿造之外,并告诉Matlab加载该版本。
https://stackoverflow.com/questions/70304733
复制相似问题