pyenv: MATLAB finds the executable, but not the library
11 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 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!