我正在尝试在MacOS Catalina上使用命令 install.package('RPostgreSQL')安装软件包。我正在使用名为 myenvname 的conda环境。我正在使用RStudio,但是我对R的经验不足,所以也许我缺少一些简单的东西。这是错误:
ld: warning: -pie being ignored. It is only used when linking a main executable
installing to /Users/matteo/anaconda3/envs/myenvname/lib/R/library/RPostgreSQL/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Error: package or namespace load failed for ‘RPostgreSQL’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Users/matteo/anaconda3/envs/myenvname/lib/R/library/RPostgreSQL/libs/RPostgreSQL.so':
dlopen(/Users/matteo/anaconda3/envs/myenvname/lib/R/library/RPostgreSQL/libs/RPostgreSQL.so, 6): Library not loaded: @rpath/libpq.5.dylib
Referenced from: /Users/matteo/anaconda3/envs/myenvname/lib/R/library/RPostgreSQL/libs/RPostgreSQL.so
Reason: image not found
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/Users/matteo/anaconda3/envs/myenvname/lib/R/library/RPostgreSQL’
Warning in install.packages :
installation of package ‘RPostgreSQL’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/t8/mgsmmnqj3sdg006njktkdysh0000gn/T/Rtmp8PFVMB/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done