我嘗試使用Revolution R Open 3.2.2在macOS上安裝psych軟件包。我用install.packages("psych")
和所有的依賴關係將被下載。 第一個依賴項已成功解壓縮。無法使用Revolution R打開在macOS上安裝package psych 3.2.2
出現以下情況算賬:
gfortran -arch x86_64 -fPIC -g -O2 -c biv-nt.f -o biv-nt.o
gfortran -arch x86_64 -fPIC -g -O2 -c sadmvnt.f -o sadmvnt.o
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/Users/Shared/Jenkins/workspace/External-R-3.3.2/vendor/build/lib -o mnormt.so biv-nt.o sadmvnt.o -L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3/x86_64 -L/usr/local/lib/x86_64 -L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3 -L/usr/local/lib -lgfortran -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
ld: warning: directory not found for option '-L/Users/Shared/Jenkins/workspace/External-R-3.3.2/vendor/build/lib'
ld: warning: directory not found for option '-L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3/x86_64'
ld: warning: directory not found for option '-L/usr/local/lib/x86_64'
ld: warning: directory not found for option '-L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3'
ld: library not found for -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [mnormt.so] Error 1
ERROR: compilation failed for package ‘mnormt’
* removing ‘/Users/sebastian/Library/R/3.3/library/mnormt’
Warning in install.packages :
installation of package ‘mnormt’ had non-zero exit status
ERROR: dependency ‘mnormt’ is not available for package ‘psych’
* removing ‘/Users/sebastian/Library/R/3.3/library/psych’
Warning in install.packages :
installation of package ‘psych’ had non-zero exit status
The downloaded source packages are in
/private/var/folders/8d/tdsm42091lz926w1q2lx77c40000gn/T/RtmpHxWPQe/downloaded_packages
我的系統:
R version 3.3.2 (2016-10-31)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Sierra 10.12.1
這也發生了其他的包,但並不適用於所有。我安裝了ggplot2,dplyr或tidyr,一切正常。
重點線:'LD:庫找不到-lgfortran';安裝['gfortran'](https://cran.rstudio.com/bin/macosx/tools/) – hrbrmstr
請勿安裝'gfortran 4.2.3'。到達[here](http://R.research.att.com/libs/)上的libs目錄並查找'gfortran'並在文件末尾讀取註釋。 – Bhas
感謝您的第一個答案。 @Bhas:我嘗試了以下方法:'curl -O http://r.research.att.com/libs/gmp-4.2.4-darwin8-bin4.tar.gz sudo tar fvxz gmp-4.2.4-darwin8 -bin4.tar.gz -C /'將一些文件複製到不同的文件夾中,但是當將其複製到'usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2 /無法通過符號鏈接提取usr/local/lib/gcc'occurs – sebastiann