libblas Does Not Exist During torch Import
Symptom
After torch is installed in the system, a message "ImportError: libblas.so.3: cannot open shared object file: No such file or directory" is displayed when torch is imported.
Cause Analysis
The OpenBLAS dependency is not installed in the system. As a result, the library does not exist.
Solution
- Install the system dependency.
yum install openblas
- Create soft links (subject to the actual library version).
- Search for the libopenblas-r0.3.9.so file (the displayed version varies according to the actual situation).
find / -name libopenblas*.so
- Create soft links.
ln -s /usr/lib64/libopenblas-r0.3.9.so /usr/lib64/libblas.so.3 ln -s /usr/lib64/libopenblas-r0.3.9.so /usr/lib64/liblapack.so.3
- Search for the libopenblas-r0.3.9.so file (the displayed version varies according to the actual situation).
Parent topic: System Dependency-related FAQs