Using mwpython with conda environment (MacOS, M1)
이전 댓글 표시
Running a python script which uses the MatLab runtime, I encounter:
RuntimeError: On the Mac, you must run mwpython rather than python to start a session or script that imports your package. For more details, execute "mwpython -help" or see the package documentation.
MatLab runtime version 2022b. Using a conda environment as python (3.10). MacOS 12.6, M1 processor.
I am trying to run mwpython using a conda environment. With my conda environment active and executing python, trying something like this:
>>> import os
>>> import subprocess
>>> os.environ["VIRTUAL_ENV"] = "/Users/.../opt/anaconda3/envs/my_env"
>>> subprocess.call( "/Applications/MATLAB/MATLAB_Runtime/R2022b/bin/mwpython", shell=True )
However, the python prompt does not return. Instead, I get:
dyld[10217]: missing symbol called
/Applications/MATLAB/MATLAB_Runtime/R2022b/bin/mwpython: line 254: 10217 Abort trap: 6 "/Applications/MATLAB/MATLAB_Runtime/R2022b/bin/maci64/mwpython3.10.app/Contents/MacOS/mwpython3.10"
134
Would like some clarity regarding how to run mwpython using a conda environment with this bash script and where (or how) to activate/run mwpython in my script.
Thanks,
답변 (0개)
카테고리
도움말 센터 및 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!