0

I've been trying to install the "psych" and "ggplot2" packages on my work computer and keep getting the following error (see below for version information and what I've already tried):

install.packages("psych")
WARNING: Rtools is required to build R packages but no version of Rtools compatible with the currently running version of R was found. Note that the following incompatible version(s) of Rtools were found:

  - Rtools 3.2 (installed at c:\Rtools)

Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/

  There is a binary version available but the source version is later:
      binary source needs_compilation
psych  2.1.3  2.3.3             FALSE

installing the source package ‘psych’

trying URL 'https://cran.rstudio.com/src/contrib/psych_2.3.3.tar.gz'
Content type 'application/x-gzip' length 1588126 bytes (1.5 MB)
downloaded 1.5 MB

* installing *source* package 'psych' ...
** package 'psych' successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
  there is no package called 'tmvnsim'
Calls: <Anonymous> ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
ERROR: lazy loading failed for package 'psych'
* removing 'C:/Users/the.user/Documents/R/R-3.6.2/library/psych'
Warning in install.packages :
  installation of package ‘psych’ had non-zero exit status

The downloaded source packages are in
    ‘C:\Users\the.user\AppData\Local\Temp\Rtmpm0Zlci\downloaded_packages’

I've installed and ran Rtools33.exe and cleared my environment, restarted my R session, and then quit and restarted the RStudio program. I've tried the same thing with Rtools32.exe.

The OS I'm running this on is Windows 10 Enterprise -- a 64-bit OS on a x64-based processor (is that why??)

Here is the version information output from the R.Version() function:

$platform
[1] "i386-w64-mingw32"

$arch
[1] "i386"

$os
[1] "mingw32"

$system
[1] "i386, mingw32"

$status
[1] ""

$major
[1] "3"

$minor
[1] "6.2"

$year
[1] "2019"

$month
[1] "12"

$day
[1] "12"

$`svn rev`
[1] "77560"

$language
[1] "R"

$version.string
[1] "R version 3.6.2 (2019-12-12)"

$nickname
[1] "Dark and Stormy Night"

I would greatly appreciate any help!

# Error for library()
Error in library(psych) : there is no package called 'psych'
  • As per your output, your version of R is 4 years old, and needs to be updated in order to install the psych package. – Phil Jun 06 '23 at 20:02
  • @Phil, based on what? The package [`DESCRIPTION`](https://github.com/cran/psych/blob/master/DESCRIPTION) does not advertise a minimum version of R. Where does it list the requirement? – r2evans Jun 06 '23 at 20:07
  • 1
    What happens when you try to resolve the error `there is no package called 'tmvnsim'`? – r2evans Jun 06 '23 at 20:07
  • (BTW, I just removed the [tag:ggplot2] tag. You say you're having problems installing it but include no indication of how it failed, etc. If I removed the tag prematurely, I apologize, please [edit] your question and add the attempt and erring output. It might be two unrelated issues, btw, but we'll cross that bridge later...) – r2evans Jun 06 '23 at 20:09
  • 2
    I thought this might be a recursive dependency requirement (i.e. `tmvnsim` required a newer version of R), but that's not true AFAICS - tmvnsim is [on CRAN now](https://cran.r-project.org/web/packages/tmvnsim/index.html) and doesn't list any of its own dependencies (on R versions or other packages). I would follow @r2evans's suggestion (i.e., see if you can install `tmvnsim` ...) – Ben Bolker Jun 06 '23 at 20:13
  • 4
    Finally, the note about `Rtools compatible` is very relevant: per https://cran.r-project.org/bin/windows/Rtools/history.html, you need Rtools35, not Rtools32. – r2evans Jun 06 '23 at 20:13
  • Thanks both -- and sorry about the formatting -- I realized it's kinda of funky but I didn't expect SO to parse it that way. I'll try installing "tmvnsim" first, then Rtools35 and report back! Thanks both for your help! – Josh Strauss Jun 07 '23 at 17:00
  • Installing "tmvnsim" worked for "psych"! But now I get a similar error with "ggplot2" for the "lifecycle" package and that one isn't so easy. I'll make a new question for that one, but thanks @r2evans!! I think this one may need the different Rtools. I will also note that I've had no problem with this version of R on my macbook, and I don't use a newer version of R because (1) my academic advisor likes this one and (2) when I tried the newest version I was getting errors left and right for stuff I've easily done in this version. – Josh Strauss Jun 07 '23 at 17:17
  • 1
    wow I totall y just switched the numbers of 3.6.2 to 3.2.6, so thanks again on that catch @r2evans – Josh Strauss Jun 07 '23 at 17:26

0 Answers0