-
Notifications
You must be signed in to change notification settings - Fork 24.9k
Description
🐛 Describe the bug
when I try to
import torch
I encounter the problem:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
/tmp/ipykernel_3237544/4265195184.py in <cell line: 1>()
----> 1 import torch
~/.conda/envs/dnabert2/lib/python3.8/site-packages/torch/__init__.py in <module>
190 if USE_GLOBAL_DEPS:
191 _load_global_deps()
--> 192 from torch._C import * # noqa: F403
193
194 # Appease the type checker; ordinarily this binding is inserted by the
ImportError: /usr/lib64/libm.so.6: version `GLIBC_2.29' not found (required by /home/share/huadjyin/home/lihuyang/.conda/envs/dnabert2/lib/python3.8/site-packages/torch/lib/libtorch_cpu.so)
and I am working on a cluster, so there is a .so file satisfy the GLIBC version
/home/HPCBase/compilers/gcc/12.3.1/libc/lib/libm.so.6
I export this path file into .bashrc and it worked when I use Python interpreter to import torch in terminal shell
but in Jupyter Notebook, Neither adding environment variables to kernel.json nor adding the following code to jupyter_notebook_config.py works:
import os
c = get_config()
os.environ['LD_PRELOAD'] = '/home/HPCBase/compilers/gcc/12.3.1/libc/lib/libm.so.6'
c.Spawner.env.update({'LD_PRELOAD': os.environ['LD_PRELOAD']})
Why I can't just load the $LD_PRELOAD into Jupyter Notebook???
Versions
when I try to
import torch
I encounter the problem:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
/tmp/ipykernel_3237544/4265195184.py in <cell line: 1>()
----> 1 import torch
~/.conda/envs/dnabert2/lib/python3.8/site-packages/torch/__init__.py in <module>
190 if USE_GLOBAL_DEPS:
191 _load_global_deps()
--> 192 from torch._C import * # noqa: F403
193
194 # Appease the type checker; ordinarily this binding is inserted by the
ImportError: /usr/lib64/libm.so.6: version `GLIBC_2.29' not found (required by /home/share/huadjyin/home/lihuyang/.conda/envs/dnabert2/lib/python3.8/site-packages/torch/lib/libtorch_cpu.so)
and I am working on a cluster, so there is a .so file satisfy the GLIBC version
/home/HPCBase/compilers/gcc/12.3.1/libc/lib/libm.so.6
I export this path file into .bashrc and it worked when I use Python interpreter to import torch in terminal shell
but in Jupyter Notebook, Neither adding environment variables to kernel.json nor adding the following code to jupyter_notebook_config.py works:
import os
c = get_config()
os.environ['LD_PRELOAD'] = '/home/HPCBase/compilers/gcc/12.3.1/libc/lib/libm.so.6'
c.Spawner.env.update({'LD_PRELOAD': os.environ['LD_PRELOAD']})
Why I can't just load the $LD_PRELOAD into Jupyter Notebook???
cc @ezyang @gchanan @zou3519 @kadeng @msaroufim @seemethere @malfet @atalman