clang-10: error: linker command failed with exit code 1 (installing "plotly" package)

I've been trying to install RStudio through Anaconda3 for a workshop, but cannot seem to get the packages installed correctly. I'm on a fresh install of MacOS X 11.1, as well as a fresh install of Anaconda3 and RStudio.

I've provided an example of an attempt to install the "plotly" package but I have similar issues with other packages as well. The issue seems to at least begin with the "rlang" package not compiling correctly, but beyond that, I'm not sure where to start. I'm very new to R.

> install.packages("plotly")
also installing the dependencies ‘ellipsis’, ‘vctrs’, ‘rlang’
...
* installing *source* package ‘rlang’ ...
** package ‘rlang’ successfully unpacked and MD5 sums checked
** 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-10: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/Users/colemeyer/opt/anaconda3/envs/r/lib/R/share/make/shlib.mk:6: rlang.dylib] Error 1
ERROR: compilation failed for package ‘rlang’
* removing ‘/Users/colemeyer/opt/anaconda3/envs/r/lib/R/library/rlang’
Warning in install.packages :
  installation of package ‘rlang’ had non-zero exit status
ERROR: dependency ‘rlang’ is not available for package ‘ellipsis’
* removing ‘/Users/colemeyer/opt/anaconda3/envs/r/lib/R/library/ellipsis’
Warning in install.packages :
  installation of package ‘ellipsis’ had non-zero exit status
ERROR: dependencies ‘ellipsis’, ‘rlang’ are not available for package ‘vctrs’
* removing ‘/Users/colemeyer/opt/anaconda3/envs/r/lib/R/library/vctrs’
Warning in install.packages :
  installation of package ‘vctrs’ had non-zero exit status
ERROR: dependencies ‘vctrs’, ‘rlang’ are not available for package ‘plotly’
* removing ‘/Users/colemeyer/opt/anaconda3/envs/r/lib/R/library/plotly’
Warning in install.packages :
  installation of package ‘plotly’ had non-zero exit status

The downloaded source packages are in
	‘/private/var/folders/c7/82gzx10j7lx0pjvbrwp74h880000gn/T/RtmpSE1wbX/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done

I'm happy to include more code if needed. Thank you!

There have been many more reports of failures than successes related to using Anaconda as a package manager for R When I was still on macOS, I had great regard for Anaconda as a package manager for Python.

For plotly, failure to install rlang arises from an "unsupported file type" issue. It's discussed in another content in this S/O post, and the fix is not pretty, especially for users uncomfortable with the details of compiler toolchain customization.

If I were attempting to fix this, I would

  1. Fire Anaconda from R (not sure how to do this while keeping it for Python)
  2. Uninstall R
  3. Re-install XCode
  4. Re-install XCode command line tools
  5. Reinstall R

I can't eat my own dogfood on this, so wait for others to weigh in.

Thank you for the quick response! I've given this a shot, to no avail. This morning I re-downloaded the desktop version of RStudio, and that seems to work.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.