Rstudio wont load packages with tcltk details. geoR can load in terminal but not in rstudio .onLoad failed in loadNamespace() for 'tcltk', details:

Hello everyone, I am trying to use the package geoR and after installing it from the cran repository i cannot load it, then I tried downloading it via the source package still cant load.

here is my error message:

Error: package or namespace load failed for ‘geoR’:
.onLoad failed in loadNamespace() for 'tcltk', details:
call: fun(libname, pkgname)
error: Can't find a usable init.tcl in the following directories:
/builddir/vendor/build/lib/tcl8.6 ./lib/tcl8.6 ./lib/tcl8.6 ./library ./library ./tcl8.6.9/library ./tcl8.6.9/library

This probably means that Tcl wasn't installed properly.

I am on ubuntu 20.04 and am using Microsoft R open 3.5. I am almost certain the problem is something related to how rstudio is running R.

When I installed and loaded the package from the terminal it can successfully load the r package, and run an rscript using the geoR library.

The R version I am using does have tcltk capabilities.

Any help is appreciated this is very frustrating, especially since I am able to get the libraries to load in R from terminal.

I would try with CRAN R 4.0+

Check R versions

Make a quick check to ensure that Rstudio and your terminal aren't running two separate installations. In RStudio's console run version and check that the output is consistent with running R --version in a terminal.

Check library locations

I suspect the lib paths aren't the same when you're runing R from the terminal and Rstudio.
It might be that there are different directories that are being searched for libraries. In RStudio and your terminal's R, execute .libPaths() and check that the outputs are the same.

This topic was automatically closed 21 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.