Python ImportError: undefined symbol


I'm a big fan of R and Rstudio. I'm running the open-source Rstudio Server (1.3.1093) and intend to move all my data analysis workflow to Rstudio.

I encountered an error when I tried to import pytorch in Rstudio:

> reticulate::repl_python()
Python 3.8.5 (/home/xxx/anaconda3/bin/python)
Reticulate 1.18 REPL -- A Python interpreter in R.
>>> import torch
ImportError: /home/xxx/anaconda3/lib/python3.8/site-packages/torch/lib/ undefined symbol: _ZNK3c104Type14isSubtypeOfExtERKSt10shared_ptrIS0_EPSo

My pytorch and cudatoolkit (11.1) was installed by conda. Importing pytorch in python is successful.

Is there a workaround of this? Really appreciate any advice.