【发布时间】:2021-06-03 23:24:33
【问题描述】:
直到几天前,当我弄乱了软件包并不得不删除环境时,我确实已经在我的 Conda 环境上完美地运行了 R。现在我正在尝试重新创建我的环境,但一切都不再正常了。
须知:
操作系统:MacOS BigSur
Conda 环境包含:Python 3.8 和 R 3.6.1
> version
_
platform x86_64-apple-darwin13.4.0
arch x86_64
os darwin13.4.0
system x86_64, darwin13.4.0
status
major 3
minor 6.1
year 2019
month 07
day 05
svn rev 76782
language R
version.string R version 3.6.1 (2019-07-05)
nickname Action of the Toes
which R 命令显示路径为thegeorgejoseph/anaconda/envs/protonaml/bin/R
.libPaths() 显示为thegeorgejoseph/anaconda/envs/protonaml/lib/R/library
为什么它们不同?这可能是问题的原因吗?
当我尝试安装拨浪鼓时,它运行了几次然后失败说tibble、rlang 和其他几个无法安装的软件包。当我在 R 上运行 install.packages(rlang) 命令时,我得到以下回溯。
任何帮助表示赞赏,可能出了什么问题?
install.packages('rlang')
trying URL 'https://cloud.r-project.org/src/contrib/rlang_0.4.10.tar.gz'
Content type 'application/x-gzip' length 915685 bytes (894 KB)
==================================================
downloaded 894 KB
* installing *source* package ‘rlang’ ...
** package ‘rlang’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
x86_64-apple-darwin13.4.0-clang -I"/Users/thegeorgejoseph/opt/anaconda3/envs/protonaml/lib/R/include" -DNDEBUG -I./lib/ -D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -I/Users/thegeorgejoseph/opt/anaconda3/envs/protonaml/include -fPIC -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -I/Users/thegeorgejoseph/opt/anaconda3/envs/protonaml/include -fdebug-prefix-map=/opt/concourse/worker/volumes/live/59b7f007-fada-42cf-7435-5bbd0518eaa4/volume/r-base_1570124919999/work=/usr/local/src/conda/r-base-3.6.1 -fdebug-prefix-map=/Users/thegeorgejoseph/opt/anaconda3/envs/protonaml=/usr/local/src/conda-prefix -c capture.c -o capture.o
x86_64-apple-darwin13.4.0-clang -I"/Users/thegeorgejoseph/opt/anaconda3/envs/protonaml/lib/R/include" -DNDEBUG -I./lib/ -D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -I/Users/thegeorgejoseph/opt/anaconda3/envs/protonaml/include -fPIC -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -I/Users/thegeorgejoseph/opt/anaconda3/envs/protonaml/include -fdebug-prefix-map=/opt/concourse/worker/volumes/live/59b7f007-fada-42cf-7435-5bbd0518eaa4/volume/r-base_1570124919999/work=/usr/local/src/conda/r-base-3.6.1 -fdebug-prefix-map=/Users/thegeorgejoseph/opt/anaconda3/envs/protonaml=/usr/local/src/conda-prefix -c export.c -o export.o
x86_64-apple-darwin13.4.0-clang -I"/Users/thegeorgejoseph/opt/anaconda3/envs/protonaml/lib/R/include" -DNDEBUG -I./lib/ -D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -I/Users/thegeorgejoseph/opt/anaconda3/envs/protonaml/include -fPIC -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -I/Users/thegeorgejoseph/opt/anaconda3/envs/protonaml/include -fdebug-prefix-map=/opt/concourse/worker/volumes/live/59b7f007-fada-42cf-7435-5bbd0518eaa4/volume/r-base_1570124919999/work=/usr/local/src/conda/r-base-3.6.1 -fdebug-prefix-map=/Users/thegeorgejoseph/opt/anaconda3/envs/protonaml=/usr/local/src/conda-prefix -c internal.c -o internal.o
x86_64-apple-darwin13.4.0-clang -I"/Users/thegeorgejoseph/opt/anaconda3/envs/protonaml/lib/R/include" -DNDEBUG -I./lib/ -D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -I/Users/thegeorgejoseph/opt/anaconda3/envs/protonaml/include -fPIC -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -I/Users/thegeorgejoseph/opt/anaconda3/envs/protonaml/include -fdebug-prefix-map=/opt/concourse/worker/volumes/live/59b7f007-fada-42cf-7435-5bbd0518eaa4/volume/r-base_1570124919999/work=/usr/local/src/conda/r-base-3.6.1 -fdebug-prefix-map=/Users/thegeorgejoseph/opt/anaconda3/envs/protonaml=/usr/local/src/conda-prefix -c lib.c -o lib.o
x86_64-apple-darwin13.4.0-clang -I"/Users/thegeorgejoseph/opt/anaconda3/envs/protonaml/lib/R/include" -DNDEBUG -I./lib/ -D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -I/Users/thegeorgejoseph/opt/anaconda3/envs/protonaml/include -fPIC -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -I/Users/thegeorgejoseph/opt/anaconda3/envs/protonaml/include -fdebug-prefix-map=/opt/concourse/worker/volumes/live/59b7f007-fada-42cf-7435-5bbd0518eaa4/volume/r-base_1570124919999/work=/usr/local/src/conda/r-base-3.6.1 -fdebug-prefix-map=/Users/thegeorgejoseph/opt/anaconda3/envs/protonaml=/usr/local/src/conda-prefix -c version.c -o version.o
x86_64-apple-darwin13.4.0-clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Users/thegeorgejoseph/opt/anaconda3/envs/protonaml/lib/R/lib -Wl,-dead_strip_dylibs -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,/Users/thegeorgejoseph/opt/anaconda3/envs/protonaml/lib -L/Users/thegeorgejoseph/opt/anaconda3/envs/protonaml/lib -o rlang.dylib capture.o export.o internal.o lib.o version.o -L/Users/thegeorgejoseph/opt/anaconda3/envs/protonaml/lib/R/lib -lR -Wl,-framework -Wl,CoreFoundation
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-10: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/Users/thegeorgejoseph/opt/anaconda3/envs/protonaml/lib/R/share/make/shlib.mk:6: rlang.dylib] Error 1
ERROR: compilation failed for package ‘rlang’
* removing ‘/Users/thegeorgejoseph/opt/anaconda3/envs/protonaml/lib/R/library/rlang’
PS:我也尝试将 Rstudio 安装到环境中,但使用 install.packages() 命令时遇到了同样的错误。
但是,在创建新环境并使用 Anaconda 的 R 通道安装我需要的每个包时,安装成功并且不会引发任何错误,但我仍然无法使用 library(rattle) 在脚本中加载库。
【问题讨论】:
-
不要通过 Conda 安装 Rstudio - 只有旧版本,而且你不想在每个环境中都安装一个巨大的 IDE。在系统或用户级别安装 RStudio 和launch it with the environment activated。