undefined symbol: LAPACKE_ztgevc_work

OSError: /home/li/Desktop/anaconda/envs/voice2/lib/python3.8/site-packages/torch/lib/…/…/…/…/libmkl_intel_lp64.so: undefined symbol: LAPACKE_ztgevc_work

It seems MKL has issues finding the right symbols. How did you install PyTorch?

“I installed PyTorch using the ‘conda install pytorch’ command.”

Could you post a minimal and executable code snippet reproducing the issue, please?

import torch
Traceback (most recent call last):
File “”, line 1, in
File “/home/li/Desktop/anaconda/envs/voice2/lib/python3.8/site-packages/torch/init.py”, line 533, in
for name in dir(_C):
NameError: name ‘_C’ is not defined Simply using ‘import torch’ results in an error, and surprisingly, the cause of this error is different from the last time!

I cannot reproduce the issue by installing the latest CPU-only binary via conda install pytorch:

conda install pytorch 
Channels:
 - defaults
Platform: linux-64
...
The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    blas-1.0                   |              mkl           6 KB
    cffi-1.16.0                |  py310h5eee18b_0         253 KB
    filelock-3.13.1            |  py310h06a4308_0          21 KB
    fsspec-2023.10.0           |  py310h06a4308_0         271 KB
    gmp-6.2.1                  |       h295c915_3         544 KB
    gmpy2-2.1.2                |  py310heeb90bb_0         517 KB
    intel-openmp-2023.1.0      |   hdb19cb5_46306        17.2 MB
    jinja2-3.1.3               |  py310h06a4308_0         273 KB
    libprotobuf-3.20.3         |       he621ea3_0         2.4 MB
    markupsafe-2.1.3           |  py310h5eee18b_0          22 KB
    mkl-2023.1.0               |   h213fc3f_46344       171.5 MB
    mkl-service-2.4.0          |  py310h5eee18b_1          54 KB
    mkl_fft-1.3.8              |  py310h5eee18b_0         216 KB
    mkl_random-1.2.4           |  py310hdb19cb5_0         312 KB
    mpc-1.1.0                  |       h10f8cd9_1          90 KB
    mpfr-4.0.2                 |       hb69a4c5_1         487 KB
    mpmath-1.3.0               |  py310h06a4308_0         834 KB
    networkx-3.1               |  py310h06a4308_0         2.8 MB
    ninja-1.10.2               |       h06a4308_5           8 KB
    ninja-base-1.10.2          |       hd09550d_5         109 KB
    numpy-1.26.4               |  py310h5f9d8c6_0          11 KB
    numpy-base-1.26.4          |  py310hb5e798b_0         7.2 MB
    pytorch-2.2.0              |cpu_py310hdc00b08_0        70.6 MB
    sympy-1.12                 |  py310h06a4308_0        10.5 MB
    tbb-2021.8.0               |       hdb19cb5_0         1.6 MB
    typing_extensions-4.9.0    |  py310h06a4308_1          55 KB
    ------------------------------------------------------------
                                           Total:       287.7 MB
python                                                                                                                                                                    
Python 3.10.14 (main, Mar 21 2024, 16:24:04) [GCC 11.2.0] on linux                                                                                                                                                 
Type "help", "copyright", "credits" or "license" for more information.                                                                                                                                             
>>> import torch
>>> print(torch.__version__)                                                                                                                                                                                       
2.2.0                                     

I’ll try what you said again later, thank you!