Discussion:
[R-SIG-Mac] rlang and the new R version 4.1.0
Hans W
2021-05-25 13:16:19 UTC
Permalink
I installed the new R version 4.1.0 on my (normal) Macbook, and
everything seemed to work fine until one of the packages depended on
library(rlang)
Error: package or namespace load failed for ‘rlang’ in
dyn.load(file, DLLpath = DLLpath, ...): unable to load
shared object '/Users/hwb/Library/R/4.0/library/rlang/libs/rlang.so':
dlopen(/Users/hwb/Library/R/4.0/library/rlang/libs/rlang.so, 6):
Library not loaded:
/Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib
Referenced from: /Users/hwb/Library/R/4.0/library/rlang/libs/rlang.so
Reason: image not found

So I removed 'rlang' and reinstalled it. There was no error message,
but when I tried to load it, the error message was:

Error: package or namespace load failed for ‘rlang’ in
get(Info[i, 1], envir = env): lazy-load database
'/Users/hwb/Library/R/4.0/library/rlang/R/rlang.rdb' is corrupt
In addition: Warning message:
In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1

One of my current applications relies on 'rvest' which depends on
'rlang'. For the moment I am using it from a Linux computer, but it's
quite unfortunate that I cannot run it from macOS as well.

I also uninstalled the new R version and reinstalled it, but nothing
changed. Could you give me a hint on what to do (or what I did wrong)?
Kevin Ushey
2021-05-25 18:30:33 UTC
Permalink
This error:

Error: package or namespace load failed for ‘rlang’ in
get(Info[i, 1], envir = env): lazy-load database
'/Users/hwb/Library/R/4.0/library/rlang/R/rlang.rdb' is corrupt
In addition: Warning message:
In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1

is commonly seen when reinstalling an already-installed package. See
https://bugs.r-project.org/bugzilla/show_bug.cgi?id=16644 for more
details.

The resolution is to restart R after reinstalling an already-loaded package.

Best,
Kevin
On Tue, May 25, 2021 at 7:07 AM Marc Schwartz via R-SIG-Mac
Hi,
You might try a different CRAN mirror to see if perhaps the rlang binary
that you are getting is corrupted.
Looking at CRAN for the package, the results for rlang on what is
https://cran.r-project.org/web/checks/check_results_rlang.html
https://www.r-project.org/nosvn/R.check/r-release-macos-x86_64/rlang-00check.html
So, I am not clear if there is a macOS binary build issue that may be
resulting in a conflict of sorts.
A spot check of other CRAN packages (including my own) shows the same
use of R devel for macOS, and not R release, so perhaps there is a wider
issue going on with CRAN builds, unless I am missing something here.
Simon (cc'd now) may be able to address that issue.
Regards,
Marc Schwartz
Post by Hans W
I installed the new R version 4.1.0 on my (normal) Macbook, and
everything seemed to work fine until one of the packages depended on
library(rlang)
Error: package or namespace load failed for ‘rlang’ in
dyn.load(file, DLLpath = DLLpath, ...): unable to load
/Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib
Referenced from: /Users/hwb/Library/R/4.0/library/rlang/libs/rlang.so
Reason: image not found
So I removed 'rlang' and reinstalled it. There was no error message,
Error: package or namespace load failed for ‘rlang’ in
get(Info[i, 1], envir = env): lazy-load database
'/Users/hwb/Library/R/4.0/library/rlang/R/rlang.rdb' is corrupt
In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1
One of my current applications relies on 'rvest' which depends on
'rlang'. For the moment I am using it from a Linux computer, but it's
quite unfortunate that I cannot run it from macOS as well.
I also uninstalled the new R version and reinstalled it, but nothing
changed. Could you give me a hint on what to do (or what I did wrong)?
_______________________________________________
R-SIG-Mac mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-mac
_______________________________________________
R-SIG-Mac mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-mac
Hans W
2021-05-25 19:58:38 UTC
Permalink
Following this tip I had to remove and reinstall one after the other
the following packages:

rvest, rlang, magrittr, xml2, stringi, ellipsis,
fansi, utf8, vctrs, tibble, Rcpp, lbfgs, and GauPro

each time restarting R to make sure. Then the application worked again.
Does this mean I would be better off deleting all of my installed
packages and starting a fresh R?
Was this even a requirement for installing R version 4.1 on macOS -- a
requirement I didn't get?

Thanks for the help --HW
Post by Hans W
Error: package or namespace load failed for ‘rlang’ in
get(Info[i, 1], envir = env): lazy-load database
'/Users/hwb/Library/R/4.0/library/rlang/R/rlang.rdb' is corrupt
In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1
is commonly seen when reinstalling an already-installed package. See
https://bugs.r-project.org/bugzilla/show_bug.cgi?id=16644 for more
details.
The resolution is to restart R after reinstalling an already-loaded package.
Best,
Kevin
Simon Urbanek
2021-05-25 22:47:30 UTC
Permalink
Hans,

you have to re-install *all* packages whenever you upgrade R. R only guarantees compatibility between patch versions (i.e. upgrading from R 4.0.0 to 4.0.1 does not require re-install, but from R 4.0.0 to R 4.1.0 does). That was always the case on all platforms, it's not new.

Note that the R Mac GUI makes the upgrade easier - in the Package Manager you can select to install package from previous R version if you use the system location. Otherwise you can always use simply

install.packages(rownames(installed.packages("path-to-old-library")))

Cheers,
Simon
Post by Hans W
Following this tip I had to remove and reinstall one after the other
rvest, rlang, magrittr, xml2, stringi, ellipsis,
fansi, utf8, vctrs, tibble, Rcpp, lbfgs, and GauPro
each time restarting R to make sure. Then the application worked again.
Does this mean I would be better off deleting all of my installed
packages and starting a fresh R?
Was this even a requirement for installing R version 4.1 on macOS -- a
requirement I didn't get?
Thanks for the help --HW
Post by Hans W
Error: package or namespace load failed for ‘rlang’ in
get(Info[i, 1], envir = env): lazy-load database
'/Users/hwb/Library/R/4.0/library/rlang/R/rlang.rdb' is corrupt
In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1
is commonly seen when reinstalling an already-installed package. See
https://bugs.r-project.org/bugzilla/show_bug.cgi?id=16644 for more
details.
The resolution is to restart R after reinstalling an already-loaded package.
Best,
Kevin
_______________________________________________
R-SIG-Mac mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-mac
Simon Urbanek
2021-05-25 20:10:20 UTC
Permalink
Hans,

you seem to be using old library from 4.0 (see the 4.0 in the path). Make sure you remove old packages and use a clean library for 4.1 since you cannot mix packages from R 4.0.x and R 4.1.0. I would best recommend removing (or re-naming) ~/Library/R before installation to make sure you don't have incompatible old packages. Also don't forget to re-start R.

(Marc, I can't parse your post, it makes no sense to me, there no R-devel involved in any of this, so please post separately about whatever is on your heart as that doesn't seem to be related).

Cheers,
Simon
Hi,
You might try a different CRAN mirror to see if perhaps the rlang binary that you are getting is corrupted.
https://cran.r-project.org/web/checks/check_results_rlang.html
https://www.r-project.org/nosvn/R.check/r-release-macos-x86_64/rlang-00check.html
So, I am not clear if there is a macOS binary build issue that may be resulting in a conflict of sorts.
A spot check of other CRAN packages (including my own) shows the same use of R devel for macOS, and not R release, so perhaps there is a wider issue going on with CRAN builds, unless I am missing something here.
Simon (cc'd now) may be able to address that issue.
Regards,
Marc Schwartz
Post by Hans W
I installed the new R version 4.1.0 on my (normal) Macbook, and
everything seemed to work fine until one of the packages depended on
library(rlang)
Error: package or namespace load failed for ‘rlang’ in
dyn.load(file, DLLpath = DLLpath, ...): unable to load
/Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib
Referenced from: /Users/hwb/Library/R/4.0/library/rlang/libs/rlang.so
Reason: image not found
So I removed 'rlang' and reinstalled it. There was no error message,
Error: package or namespace load failed for ‘rlang’ in
get(Info[i, 1], envir = env): lazy-load database
'/Users/hwb/Library/R/4.0/library/rlang/R/rlang.rdb' is corrupt
In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1
One of my current applications relies on 'rvest' which depends on
'rlang'. For the moment I am using it from a Linux computer, but it's
quite unfortunate that I cannot run it from macOS as well.
I also uninstalled the new R version and reinstalled it, but nothing
changed. Could you give me a hint on what to do (or what I did wrong)?
_______________________________________________
R-SIG-Mac mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-mac
Jeff Newmiller
2021-05-25 20:53:30 UTC
Permalink
There are many of these. Some of these "solutions" copy the actual installed packages and then run "update.packages"... which is a very bad idea. Other solutions identify the names of the packages and install fresh (good idea) but they will hiccup when you install from non-standard sources. So some people will conclude that the former are "better" and then complain that "things don't work" when they should have preferred the latter and invested the effort needed for those non-standard sources.

You would be doing a service if you identified the blog you used so the mailing list archive can clarify to future readers which category of "solution" you had followed when you encountered this problem.

Do read snippets from the Internets before running them.
When R4.0 came out, someone on R-Bloggers post a very nice to automate
updating your packages from R3.6. I just used it to do my update from
R4.0 to R4.1 - it works perfectly. I would include the script here,
but since I don't have the exact reference I don't like posting someone
else's script without appropriate credit. Do a search and you should
be able to find the entry.
-Roy
On May 25, 2021, at 1:10 PM, Simon Urbanek
Hans,
you seem to be using old library from 4.0 (see the 4.0 in the path).
Make sure you remove old packages and use a clean library for 4.1 since
you cannot mix packages from R 4.0.x and R 4.1.0. I would best
recommend removing (or re-naming) ~/Library/R before installation to
make sure you don't have incompatible old packages. Also don't forget
to re-start R.
(Marc, I can't parse your post, it makes no sense to me, there no
R-devel involved in any of this, so please post separately about
whatever is on your heart as that doesn't seem to be related).
Cheers,
Simon
Hi,
You might try a different CRAN mirror to see if perhaps the rlang
binary that you are getting is corrupted.
Looking at CRAN for the package, the results for rlang on what is
https://cran.r-project.org/web/checks/check_results_rlang.html
https://www.r-project.org/nosvn/R.check/r-release-macos-x86_64/rlang-00check.html
So, I am not clear if there is a macOS binary build issue that may
be resulting in a conflict of sorts.
A spot check of other CRAN packages (including my own) shows the
same use of R devel for macOS, and not R release, so perhaps there is a
wider issue going on with CRAN builds, unless I am missing something
here.
Simon (cc'd now) may be able to address that issue.
Regards,
Marc Schwartz
Post by Hans W
I installed the new R version 4.1.0 on my (normal) Macbook, and
everything seemed to work fine until one of the packages depended
on
Post by Hans W
library(rlang)
Error: package or namespace load failed for ‘rlang’ in
dyn.load(file, DLLpath = DLLpath, ...): unable to load
shared object
/Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib
/Users/hwb/Library/R/4.0/library/rlang/libs/rlang.so
Post by Hans W
Reason: image not found
So I removed 'rlang' and reinstalled it. There was no error
message,
Post by Hans W
Error: package or namespace load failed for ‘rlang’ in
get(Info[i, 1], envir = env): lazy-load database
'/Users/hwb/Library/R/4.0/library/rlang/R/rlang.rdb' is corrupt
In get(Info[i, 1], envir = env) : internal error -3 in
R_decompress1
Post by Hans W
One of my current applications relies on 'rvest' which depends on
'rlang'. For the moment I am using it from a Linux computer, but
it's
Post by Hans W
quite unfortunate that I cannot run it from macOS as well.
I also uninstalled the new R version and reinstalled it, but
nothing
Post by Hans W
changed. Could you give me a hint on what to do (or what I did
wrong)?
Post by Hans W
_______________________________________________
R-SIG-Mac mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-mac
_______________________________________________
R-SIG-Mac mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-mac
**********************
"The contents of this message do not reflect any position of the U.S.
Government or NOAA."
**********************
Roy Mendelssohn
Supervisory Operations Research Analyst
NOAA/NMFS
Environmental Research Division
Southwest Fisheries Science Center
***Note new street address***
110 McAllister Way
Santa Cruz, CA 95060
Phone: (831)-420-3666
Fax: (831) 420-3980
"Old age and treachery will overcome youth and skill."
"From those who have been given much, much will be expected"
"the arc of the moral universe is long, but it bends toward justice"
-MLK Jr.
_______________________________________________
R-SIG-Mac mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-mac
--
Sent from my phone. Please excuse my brevity.
Loading...