Installing torch: undefined symbol for

Hey guys,

I try to install the R-Version of pytorch CPU, to avoid using reticulate as a workaround.
I simply used install.packages("torch") which successfully finished.

When using library(torch) after that, it states that there must be two additional system dependencies installed, e.g. libtorch and liblantern

So running install_torch() manually downloads both dependencies as zip files. However, then the following error occurs:

trying URL ''
Content type 'application/zip' length 4844513 bytes (4.6 MB)
downloaded 4.6 MB

/R/x86_64-pc-linux-gnu-library/4.2/torch/lib/ undefined symbol:

Any ideas how to solve this?

Hi @Micha1

What OS version are you running? Looks like it might be a glibc compatibility issue.


Hi @dfalbel ,

thank for your reply!
I'm running on an Ubuntu 22.04 LTS x86_64

1 Like

That's a weird issue, I couldn't reproduce. I think this might be an error caused by some problem when downloading the additional dependencies. Does the same error repeat if you simply re-install the package? Ie, running install.packages("torch") again?

Unfornately, yes :confused: That being sad, running the code you shared runs through, but as I said whenever I call library(torch), posit states that there are missing dependencies., i.e. libtorch and liblantern. I also tried to download the zip-files manually and provide posit with the path to the files - same error. Strangely, in the /torch/lib folder, there is an

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.