pyenv: MATLAB finds the executable, but not the library
이전 댓글 표시
We're running a rather complicated workflow that compares different implementations of the same algorithm. We need to call a Python library that has been installed at root via a Gitlab CI pipeline. The install script is as follows:
#!/bin/bash
# Download Python 3.9 source code and extract
wget -q https://www.python.org/ftp/python/3.9.10/Python-3.9.10.tgz && \
tar -xf Python-3.9.10.tgz && \
cd Python-3.9.10
# Configure, build, and install Python 3.9
./configure --enable-optimizations && \
make -j $(nproc) && \
make altinstall
# Install pip and setuptools
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
python3.9 get-pip.py && \
pip unistall --root-user-action=ignore && \
pip install setuptools
# Create symbolic link to python binary
ln -s /usr/local/bin/python3.9 /usr/local/bin/python
#Install special package
pip install --upgrade pip
pip install special-package
# Cleanup
cd .. && \
rm -rf Python-3.9.10.tgz Python-3.9.10
Calling pyenv reveals that MATLAB can find the executable, but not the library:
PythonEnvironment with properties:
Version: "3.9"
Executable: "/usr/local/bin/python"
Library: ""
Home: "/usr/local"
Status: NotLoaded
ExecutionMode: InProcess
Are we missing a step in the set-up? Using pyenv to force MATLAB to look in the right place doesn't work. Hardcoding paths at the top of the main MATLAB script doesn't work. We're also struggling to reproduce the problem on local machines, so it's difficult to debug this.
답변 (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!