libblas Does Not Exist During torch Import
Symptom
After torch 1.8.1 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 a soft link (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 a soft link.
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: FAQs