Mac系统的anaconda环境下的rstudio无法正常安装sentimentr包,如何解决?

问题遇到的现象和发生背景

本科语言学新生,之前一直使用Mac系统下的anaconda来进行python的编写。做情感分析需要用到R语言中的sentimentr包,于是在anaconda新建的channel中安装了rstudio。发现无法正常安装sentimentr包,无论是通过CRAN、镜像还是通过下载.tar文件手动安装都会报错。

问题相关代码,请勿粘贴截图
> install.packages("sentimentr")

运行结果及报错内容
also installing the dependencies ‘colorspace’, ‘nlme’, ‘Matrix’, ‘farver’, ‘lifecycle’, ‘munsell’, ‘lattice’, ‘isoband’, ‘MASS’, ‘mgcv’, ‘rlang’, ‘scales’, ‘zoo’, ‘slam’, ‘data.table’, ‘ggplot2’, ‘lexicon’, ‘syuzhet’, ‘textclean’, ‘textshape’

试开URL’https://cran.rstudio.com/src/contrib/colorspace_2.0-2.tar.gz'
Content type 'application/x-gzip' length 2196563 bytes (2.1 MB)
==================================================
downloaded 2.1 MB

试开URL’https://cran.rstudio.com/src/contrib/nlme_3.1-155.tar.gz'
Content type 'application/x-gzip' length 806854 bytes (787 KB)
==================================================
downloaded 787 KB

试开URL’https://cran.rstudio.com/src/contrib/Matrix_1.4-0.tar.gz'
Content type 'application/x-gzip' length 2849865 bytes (2.7 MB)
==================================================
downloaded 2.7 MB

试开URL’https://cran.rstudio.com/src/contrib/farver_2.1.0.tar.gz'
Content type 'application/x-gzip' length 1281864 bytes (1.2 MB)
==================================================
downloaded 1.2 MB

试开URL’https://cran.rstudio.com/src/contrib/lifecycle_1.0.1.tar.gz'
Content type 'application/x-gzip' length 99716 bytes (97 KB)
==================================================
downloaded 97 KB

试开URL’https://cran.rstudio.com/src/contrib/munsell_0.5.0.tar.gz'
Content type 'application/x-gzip' length 182653 bytes (178 KB)
==================================================
downloaded 178 KB

试开URL’https://cran.rstudio.com/src/contrib/lattice_0.20-45.tar.gz'
Content type 'application/x-gzip' length 399470 bytes (390 KB)
==================================================
downloaded 390 KB

试开URL’https://cran.rstudio.com/src/contrib/isoband_0.2.5.tar.gz'
Content type 'application/x-gzip' length 1671911 bytes (1.6 MB)
==================================================
downloaded 1.6 MB

试开URL’https://cran.rstudio.com/src/contrib/MASS_7.3-55.tar.gz'
Content type 'application/x-gzip' length 508478 bytes (496 KB)
==================================================
downloaded 496 KB

试开URL’https://cran.rstudio.com/src/contrib/mgcv_1.8-38.tar.gz'
Content type 'application/x-gzip' length 1207405 bytes (1.2 MB)
==================================================
downloaded 1.2 MB

试开URL’https://cran.rstudio.com/src/contrib/rlang_1.0.1.tar.gz'
Content type 'application/x-gzip' length 717371 bytes (700 KB)
==================================================
downloaded 700 KB

试开URL’https://cran.rstudio.com/src/contrib/scales_1.1.1.tar.gz'
Content type 'application/x-gzip' length 515201 bytes (503 KB)
==================================================
downloaded 503 KB

试开URL’https://cran.rstudio.com/src/contrib/zoo_1.8-9.tar.gz'
Content type 'application/x-gzip' length 793891 bytes (775 KB)
==================================================
downloaded 775 KB

试开URL’https://cran.rstudio.com/src/contrib/slam_0.1-50.tar.gz'
Content type 'application/x-gzip' length 53641 bytes (52 KB)
==================================================
downloaded 52 KB

试开URL’https://cran.rstudio.com/src/contrib/data.table_1.14.2.tar.gz'
Content type 'application/x-gzip' length 5301817 bytes (5.1 MB)
==================================================
downloaded 5.1 MB

试开URL’https://cran.rstudio.com/src/contrib/ggplot2_3.3.5.tar.gz'
Content type 'application/x-gzip' length 3063309 bytes (2.9 MB)
==================================================
downloaded 2.9 MB

试开URL’https://cran.rstudio.com/src/contrib/lexicon_1.2.1.tar.gz'
Content type 'application/x-gzip' length 2516233 bytes (2.4 MB)
==================================================
downloaded 2.4 MB

试开URL’https://cran.rstudio.com/src/contrib/syuzhet_1.0.6.tar.gz'
Content type 'application/x-gzip' length 3059075 bytes (2.9 MB)
==================================================
downloaded 2.9 MB

试开URL’https://cran.rstudio.com/src/contrib/textclean_0.9.3.tar.gz'
Content type 'application/x-gzip' length 1131554 bytes (1.1 MB)
==================================================
downloaded 1.1 MB

试开URL’https://cran.rstudio.com/src/contrib/textshape_1.7.3.tar.gz'
Content type 'application/x-gzip' length 697969 bytes (681 KB)
==================================================
downloaded 681 KB

试开URL’https://cran.rstudio.com/src/contrib/sentimentr_2.9.0.tar.gz'
Content type 'application/x-gzip' length 3851533 bytes (3.7 MB)
==================================================
downloaded 3.7 MB

* installing *source* package ‘colorspace’ ...
** 成功将‘colorspace’程序包解包并MD5和检查
** using staged installation
** libs
...
ld: warning: -pie being ignored. It is only used when linking a main executable
ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd' for architecture x86_64
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/Users/chongchong/opt/anaconda3/envs/rstudio/lib/R/share/make/shlib.mk:6: colorspace.dylib] Error 1
ERROR: compilation failed for package ‘colorspace’
* removing ‘/Users/chongchong/opt/anaconda3/envs/rstudio/lib/R/library/colorspace’
Warning in install.packages :
  installation of package ‘colorspace’ had non-zero exit status
* installing *source* package ‘farver’ ...
** 成功将‘farver’程序包解包并MD5和检查
** using staged installation
** libs
...
ld: warning: -pie being ignored. It is only used when linking a main executable
ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd' for architecture x86_64
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/Users/chongchong/opt/anaconda3/envs/rstudio/lib/R/share/make/shlib.mk:6: farver.dylib] Error 1
ERROR: compilation failed for package ‘farver’
* removing ‘/Users/chongchong/opt/anaconda3/envs/rstudio/lib/R/library/farver’
Warning in install.packages :
  installation of package ‘farver’ had non-zero exit status
* installing *source* package ‘lattice’ ...
** 成功将‘lattice’程序包解包并MD5和检查
** using staged installation
** libs
...
ld: warning: -pie being ignored. It is only used when linking a main executable
ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd' for architecture x86_64
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/Users/chongchong/opt/anaconda3/envs/rstudio/lib/R/share/make/shlib.mk:6: lattice.dylib] Error 1
ERROR: compilation failed for package ‘lattice’
* removing ‘/Users/chongchong/opt/anaconda3/envs/rstudio/lib/R/library/lattice’
Warning in install.packages :
  installation of package ‘lattice’ had non-zero exit status
* installing *source* package ‘isoband’ ...
** 成功将‘isoband’程序包解包并MD5和检查
** using staged installation
** libs
...
ld: warning: -pie being ignored. It is only used when linking a main executable
ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd' for architecture x86_64
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/Users/chongchong/opt/anaconda3/envs/rstudio/lib/R/share/make/shlib.mk:6: isoband.dylib] Error 1
ERROR: compilation failed for package ‘isoband’
* removing ‘/Users/chongchong/opt/anaconda3/envs/rstudio/lib/R/library/isoband’
Warning in install.packages :
  installation of package ‘isoband’ had non-zero exit status
* installing *source* package ‘MASS’ ...
** 成功将‘MASS’程序包解包并MD5和检查
** using staged installation
** libs
...
ld: warning: -pie being ignored. It is only used when linking a main executable
ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd' for architecture x86_64
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/Users/chongchong/opt/anaconda3/envs/rstudio/lib/R/share/make/shlib.mk:6: MASS.dylib] Error 1
ERROR: compilation failed for package ‘MASS’
* removing ‘/Users/chongchong/opt/anaconda3/envs/rstudio/lib/R/library/MASS’
Warning in install.packages :
  installation of package ‘MASS’ had non-zero exit status
* installing *source* package ‘rlang’ ...
** 成功将‘rlang’程序包解包并MD5和检查
** using staged installation
** libs
...
ld: warning: -pie being ignored. It is only used when linking a main executable
ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd' for architecture x86_64
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/Users/chongchong/opt/anaconda3/envs/rstudio/lib/R/share/make/shlib.mk:6: rlang.dylib] Error 1
ERROR: compilation failed for package ‘rlang’
* removing ‘/Users/chongchong/opt/anaconda3/envs/rstudio/lib/R/library/rlang’
* restoring previous/Users/chongchong/opt/anaconda3/envs/rstudio/lib/R/library/rlang’
Warning in install.packages :
  installation of package ‘rlang’ had non-zero exit status
* installing *source* package ‘slam’ ...
** 成功将‘slam’程序包解包并MD5和检查
** using staged installation
** libs
...
ld: warning: -pie being ignored. It is only used when linking a main executable
ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libm.tbd' for architecture x86_64
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/Users/chongchong/opt/anaconda3/envs/rstudio/lib/R/share/make/shlib.mk:6: slam.dylib] Error 1
ERROR: compilation failed for package ‘slam’
* removing ‘/Users/chongchong/opt/anaconda3/envs/rstudio/lib/R/library/slam’
Warning in install.packages :
  installation of package ‘slam’ had non-zero exit status
* installing *source* package ‘data.table’ ...
** 成功将‘data.table’程序包解包并MD5和检查
** using staged installation
*** pkg-config is not installed.
*** Compilation will now be attempted and if it works you can ignore this message. In
*** particular, this should be the case on Mac where zlib is built in or pkg-config
*** is not installed. However, if compilation fails, try 'locate zlib.h zconf.h' and
*** ensure the zlib development library is installed :
***   deb: zlib1g-dev (Debian, Ubuntu, ...)
***   rpm: zlib-devel (Fedora, EPEL, ...)
***   There is a zlib in brew for OSX but the built in zlib should work.
*** Note that zlib is required to compile R itself so you may find the advice in the R-admin
*** guide helpful regarding zlib. On Debian/Ubuntu, zlib1g-dev is a dependency of r-base as
*** shown by 'apt-cache showsrc r-base | grep ^Build-Depends | grep zlib', and therefore
*** 'sudo apt-get build-dep r-base' should be sufficient too.
*** To silence this message, please ensure that :
***   1) 'pkg-config --exists zlib' succeeds (i.e. $? -eq 0)
***   2) 'pkg-config --libs zlib' contains -lz
*** Compilation will now be attempted ...
ld: library not found for -lomp
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
*** OpenMP not supported! data.table uses OpenMP to automatically
***   parallelize operations like sorting, grouping, file reading, etc.
*** For details on how to install the necessary toolchains on your OS see:
***   https://github.com/Rdatatable/data.table/wiki/Installation
*** Continuing installation without OpenMP support...
*** Compilation without compression support in fwrite
** libs
...
ld: warning: -pie being ignored. It is only used when linking a main executable
ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd' for architecture x86_64
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/Users/chongchong/opt/anaconda3/envs/rstudio/lib/R/share/make/shlib.mk:6: data.table.dylib] Error 1
ERROR: compilation failed for package ‘data.table’
* removing ‘/Users/chongchong/opt/anaconda3/envs/rstudio/lib/R/library/data.table’
Warning in install.packages :
  installation of package ‘data.table’ had non-zero exit status
ERROR: dependency ‘lattice’ is not available for package ‘nlme’
* removing ‘/Users/chongchong/opt/anaconda3/envs/rstudio/lib/R/library/nlme’
Warning in install.packages :
  installation of package ‘nlme’ had non-zero exit status
ERROR: dependency ‘lattice’ is not available for package ‘Matrix’
* removing ‘/Users/chongchong/opt/anaconda3/envs/rstudio/lib/R/library/Matrix’
Warning in install.packages :
  installation of package ‘Matrix’ had non-zero exit status
* installing *source* package ‘lifecycle’ ...
** 成功将‘lifecycle’程序包解包并MD5和检查
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : 
  namespace ‘rlang’ 0.3.4 is being loaded, but >= 0.4.10 is required
Calls: <Anonymous> ... withCallingHandlers -> loadNamespace -> namespaceImport -> loadNamespace
停止执行
ERROR: lazy loading failed for package ‘lifecycle’
* removing ‘/Users/chongchong/opt/anaconda3/envs/rstudio/lib/R/library/lifecycle’
Warning in install.packages :
  installation of package ‘lifecycle’ had non-zero exit status
ERROR: dependency ‘colorspace’ is not available for package ‘munsell’
* removing ‘/Users/chongchong/opt/anaconda3/envs/rstudio/lib/R/library/munsell’
Warning in install.packages :
  installation of package ‘munsell’ had non-zero exit status
ERROR: dependency ‘lattice’ is not available for package ‘zoo’
* removing ‘/Users/chongchong/opt/anaconda3/envs/rstudio/lib/R/library/zoo’
Warning in install.packages :
  installation of package ‘zoo’ had non-zero exit status
ERROR: dependencies ‘data.table’, ‘slam’ are not available for package ‘textshape’
* removing ‘/Users/chongchong/opt/anaconda3/envs/rstudio/lib/R/library/textshape’
Warning in install.packages :
  installation of package ‘textshape’ had non-zero exit status
ERROR: dependencies ‘nlme’, ‘Matrix’ are not available for package ‘mgcv’
* removing ‘/Users/chongchong/opt/anaconda3/envs/rstudio/lib/R/library/mgcv’
Warning in install.packages :
  installation of package ‘mgcv’ had non-zero exit status
ERROR: dependencies ‘farver’, ‘lifecycle’, ‘munsell’ are not available for package ‘scales’
* removing ‘/Users/chongchong/opt/anaconda3/envs/rstudio/lib/R/library/scales’
Warning in install.packages :
  installation of package ‘scales’ had non-zero exit status
ERROR: dependencies ‘textshape’, ‘zoo’ are not available for package ‘syuzhet’
* removing ‘/Users/chongchong/opt/anaconda3/envs/rstudio/lib/R/library/syuzhet’
Warning in install.packages :
  installation of package ‘syuzhet’ had non-zero exit status
ERROR: dependencies ‘isoband’, ‘MASS’, ‘mgcv’, ‘scales’ are not available for package ‘ggplot2’
* removing ‘/Users/chongchong/opt/anaconda3/envs/rstudio/lib/R/library/ggplot2’
Warning in install.packages :
  installation of package ‘ggplot2’ had non-zero exit status
ERROR: dependencies ‘data.table’, ‘syuzhet’ are not available for package ‘lexicon’
* removing ‘/Users/chongchong/opt/anaconda3/envs/rstudio/lib/R/library/lexicon’
Warning in install.packages :
  installation of package ‘lexicon’ had non-zero exit status
ERROR: dependencies ‘data.table’, ‘lexicon’, ‘textshape’ are not available for package ‘textclean’
* removing ‘/Users/chongchong/opt/anaconda3/envs/rstudio/lib/R/library/textclean’
Warning in install.packages :
  installation of package ‘textclean’ had non-zero exit status
ERROR: dependencies ‘data.table’, ‘ggplot2’, ‘lexicon’, ‘syuzhet’, ‘textclean’, ‘textshape’ are not available for package ‘sentimentr’
* removing ‘/Users/chongchong/opt/anaconda3/envs/rstudio/lib/R/library/sentimentr’
Warning in install.packages :
  installation of package ‘sentimentr’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/85/h9zn7p197rv7q9qq734vvvsr0000gn/T/Rtmp4QbZ0y/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
> 

我的解答思路和尝试过的方法

尝试过:1.采用清华镜像作为源安装
2.下载.tar文件进行手动安装
3.安装报错中缺少的"dependencies"之一,即data.table包,发现这个包通过上述几种方法也安装不上。

我想要达到的结果

希望能够在mac系统上的rstudio上实现sentimentr包的安装和加载,能够正常使用,谢谢大家!