You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows环境下R中仅psych包无法安装的问题求助

Hey there, let's troubleshoot this psych package installation problem you're facing. From the error messages you shared, the core issue is that your R version (3.6.3) is too old to support the latest versions of mnormt (a required dependency for psych), and even after installing Rtools, the dependency gap is blocking the installation. Here are a few actionable solutions:

R 3.6.3 dates back to 2020, and most modern packages (including mnormt and psych) have dropped support for such old versions. Upgrading R will resolve the dependency mismatch entirely:

  • Uninstall your current R version from Windows Settings.
  • Download and install the latest R release.
  • Open RStudio again, then run:
    install.packages("psych")
    
    This will automatically pull the compatible binary versions of psych and all its dependencies, no compilation needed.

2. Install Older, R 3.6-Compatible Versions of mnormt and psych

If you can't upgrade R right now, you'll need to install legacy versions of the packages that work with R 3.6.3:

Step 1: Install the compatible mnormt version

First, install devtools (if you don't have it already) to access older package versions:

install.packages("devtools")

Then install the mnormt version that supports R 3.6:

devtools::install_version("mnormt", version = "2.0.2")

If devtools gives you trouble, you can also manually download the mnormt_2.0.2.tar.gz file from the CRAN archive, then install it locally with:

install.packages("path/to/mnormt_2.0.2.tar.gz", repos = NULL, type = "source")

Step 2: Install the matching psych version

Once mnormt is installed, install the older psych version that's compatible with R 3.6:

devtools::install_version("psych", version = "1.9.12.31")

This is the binary version mentioned in your error message, and it will work with the mnormt version you just installed.

3. Verify Rtools Configuration (If You Stick to Source Installation)

Even though you installed Rtools, it might not be properly configured in your system path:

  • Run this in R to check if Rtools is detected:
    devtools::find_rtools()
    
  • If it returns FALSE, manually add the Rtools bin and mingw_64/bin directories to your Windows system PATH (e.g., C:/Rtools/bin and C:/Rtools/mingw_64/bin), then restart RStudio.

Bonus Check: Avoid OneDrive Library Path Issues

Your package library is stored in an OneDrive folder, which can sometimes cause file permission or sync conflicts. If you still run into issues after trying the above, try installing to a local non-synced folder:

install.packages("psych", lib = "C:/R/Library")

内容的提问来源于stack exchange,提问作者Katja Peganc

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.08 22:07:49