Closed roled12 closed 8 months ago
FWIW, I'm encountering the same with versions newer than 13.0.0.1
install.packages('arrow'); library('arrow')
#> Installing package into '/Users/psadil/git/arrow/renv/library/R-4.2/aarch64-apple-darwin20'
#> (as 'lib' is unspecified)
#>
#> The downloaded binary packages are in
#> /var/folders/v_/kcpb096s1m3_37ctfd2sp2xm0000gn/T//Rtmp9NnRRv/downloaded_packages
#> Error: package or namespace load failed for 'arrow' in dyn.load(file, DLLpath = DLLpath, ...):
#> unable to load shared object '/Users/psadil/git/arrow/renv/library/R-4.2/aarch64-apple-darwin20/arrow/libs/arrow.so':
#> dlopen(/Users/psadil/git/arrow/renv/library/R-4.2/aarch64-apple-darwin20/arrow/libs/arrow.so, 0x0006): symbol not found in flat namespace '__ZN5arrow12ArrayBuilder12AppendScalarERKNS_6ScalarEx'
Created on 2023-12-12 with reprex v2.0.2
remotes::install_version("arrow", "14.0.0.1")
#> Downloading package from url: https://packagemanager.posit.co/cran/latest/src/contrib/Archive/arrow/arrow_14.0.0.1.tar.gz
#> Installing package into '/Users/psadil/git/arrow/renv/library/R-4.2/aarch64-apple-darwin20'
#> (as 'lib' is unspecified)
#> Warning in i.p(...): installation of package
#> '/var/folders/v_/kcpb096s1m3_37ctfd2sp2xm0000gn/T//RtmpFv7S6a/remotes13556236975bd/arrow'
#> had non-zero exit status
Created on 2023-12-12 with reprex v2.0.2
remotes::install_version('arrow', "13.0.0.1")
#> Downloading package from url: https://packagemanager.posit.co/cran/latest/src/contrib/Archive/arrow/arrow_13.0.0.1.tar.gz
#> Installing package into '/Users/psadil/git/arrow/renv/library/R-4.2/aarch64-apple-darwin20'
#> (as 'lib' is unspecified)
Created on 2023-12-12 with reprex v2.0.2
@psadil using the package version 13.0.0.1 worked for me as well! It did the trick!
I don't know how I did not think about installing an other version before, probably the killing overload before the christmas break killed me ! 🤦♂️ 😶🌫️
Thanks for the quick response, sharing and support @psadil !!
However, I will let the issue open to get the apache-arrow support team be aware about the issue with the package version > 13.0.0.1!
cc @assignUser @paleolimbot @thisisnic
hm this reads like maybe the precompiled binaries where build without s3/gcs but the package was (correctly) build with them enabled? I don't have a mac so I will have to look at the binary but maybe @paleolimbot can test it? (which we did prior to release so it's weird that it's not working now...)
For the original source build in the post, I see you are building from R installed via Homebrew. I don't think we test or support that...perhaps R installed from the official CRAN page will work? (Even though we don't test or support installation via Homebrew, this error may point to something else that is incorrect about our installation process on MacOS, so thank you for reporting!). I suspect that in your case the linked libraries are different than those by CRAN-provided R, so I'm not sure our precompiled binaries will work (although a source build should).
For the install.packages()
error reported by @psadil, that looks like a normal R installation and the missing symbol is from Arrow itself. Normally that type of error occurs when Arrow R and Arrow C++ were built against different versions of Arrow headers.
On one of my MacOS M1s I get a somewhat concerning:
(edit: This was because Arrow was already loaded in my session...restarting R and then installing rectified the error)
> install.packages("arrow")
trying URL 'https://cran.rstudio.com/bin/macosx/big-sur-arm64/contrib/4.3/arrow_14.0.0.2.tgz'
Content type 'application/x-gzip' length 27212023 bytes (26.0 MB)
==================================================
downloaded 26.0 MB
The downloaded binary packages are in
/var/folders/gt/l87wjg8s7312zs9s7c1fgs900000gn/T//RtmprpIGyO/downloaded_packages
> library(arrow)
Attaching package: ‘arrow’
The following object is masked from ‘package:utils’:
timestamp
Warning message:
In MemoryPool__default() : internal error -3 in R_decompress1
> arrow::arrow_info()
Error in MemoryPool__default() :
lazy-load database '/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/arrow/R/arrow.rdb' is corrupt
In addition: Warning messages:
1: In MemoryPool__default() : restarting interrupted promise evaluation
2: In MemoryPool__default() : internal error -3 in R_decompress1
On my other MacOS M1, I don't have any issues. Those are both on R 4.3.1 (i.e., "release").
I can reproduce @psadil's error by installing from Posit package manager:
> install.packages("arrow", repos = "https://packagemanager.posit.co/cran/latest")
trying URL 'https://packagemanager.posit.co/cran/latest/bin/macosx/big-sur-arm64/contrib/4.3/arrow_14.0.0.2.tgz'
Content type 'binary/octet-stream' length 5434963 bytes (5.2 MB)
==================================================
downloaded 5.2 MB
The downloaded binary packages are in
/var/folders/gt/l87wjg8s7312zs9s7c1fgs900000gn/T//RtmpobGW3N/downloaded_packages
> library(arrow)
Error: package or namespace load failed for ‘arrow’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/arrow/libs/arrow.so':
dlopen(/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/arrow/libs/arrow.so, 0x0006): symbol not found in flat namespace '__ZN5arrow12ArrayBuilder12AppendScalarERKNS_6ScalarEx'
Perhaps since you're using renv that's where the binary is coming from?
I was working with renv
and had the package source set to the Posit Package Manager. Testing different sources, this is what I see:
type = "source"
, as with remotes::install_version
)type = "source"
)CRAN <- "https://cloud.r-project.org/"
PPM <- "https://packagemanager.posit.co/cran/latest"
# fails -----
install.packages("arrow", repos = PPM)
#> Installing package into '/Users/psadil/git/arrow/renv/library/R-4.3/aarch64-apple-darwin20'
#> (as 'lib' is unspecified)
#>
#> The downloaded binary packages are in
#> /var/folders/v_/kcpb096s1m3_37ctfd2sp2xm0000gn/T//RtmpyLusWt/downloaded_packages
callr::r(\(x) library("arrow"))
#> Error: ! in callr subprocess.
#> Caused by error:
#> ! package or namespace load failed for ‘arrow’ in dyn.load(file, DLLpath = DLLpath, ...):
#> unable to load shared object '/Users/psadil/git/arrow/renv/library/R-4.3/aarch64-apple-darwin20/arrow/libs/arrow.so':
#> dlopen(/Users/psadil/git/arrow/renv/library/R-4.3/aarch64-apple-darwin20/arrow/libs/arrow.so, 0x0006): symbol not found in flat namespace '__ZN5arrow12ArrayBuilder12AppendScalarERKNS_6ScalarEx'
# fails -----
remotes::install_version("arrow", "14.0.0.2", repos = PPM)
#> Downloading package from url: https://packagemanager.posit.co/cran/latest/src/contrib/arrow_14.0.0.2.tar.gz
#> Installing package into '/Users/psadil/git/arrow/renv/library/R-4.3/aarch64-apple-darwin20'
#> (as 'lib' is unspecified)
#> Warning in i.p(...): installation of package
#> '/var/folders/v_/kcpb096s1m3_37ctfd2sp2xm0000gn/T//RtmpyLusWt/remotes1cf77b6510ae/arrow'
#> had non-zero exit status
remotes::install_version("arrow", "14.0.0.2", repos = CRAN)
#> Downloading package from url: https://cloud.r-project.org/src/contrib/arrow_14.0.0.2.tar.gz
#> Installing package into '/Users/psadil/git/arrow/renv/library/R-4.3/aarch64-apple-darwin20'
#> (as 'lib' is unspecified)
#> Warning in i.p(...): installation of package
#> '/var/folders/v_/kcpb096s1m3_37ctfd2sp2xm0000gn/T//RtmpyLusWt/remotes1cf7134a78d1/arrow'
#> had non-zero exit status
# succeeds -----
install.packages("arrow", repos = CRAN)
#> Installing package into '/Users/psadil/git/arrow/renv/library/R-4.3/aarch64-apple-darwin20'
#> (as 'lib' is unspecified)
#>
#> The downloaded binary packages are in
#> /var/folders/v_/kcpb096s1m3_37ctfd2sp2xm0000gn/T//RtmpyLusWt/downloaded_packages
callr::r(\(x) library("arrow"))
#> [1] "arrow" "stats" "graphics" "grDevices" "datasets" "utils"
#> [7] "methods" "base"
remotes::install_version("arrow", "13.0.0.1", repos = PPM)
#> Downloading package from url: https://packagemanager.posit.co/cran/latest/src/contrib/Archive/arrow/arrow_13.0.0.1.tar.gz
#> Installing package into '/Users/psadil/git/arrow/renv/library/R-4.3/aarch64-apple-darwin20'
#> (as 'lib' is unspecified)
Created on 2023-12-13 with reprex v2.0.2
I can repro on github actions: https://github.com/assignUser/test-repo-a/actions/runs/7202352843/job/19620310001#step:3:96 CRAN version works fine though.
The non-working PPM binary is caused by the issue reported by Jeroen in #38855 where the host system is used to download the pre-compiled binary which is of course not suiteable for the target system (mac):
arrow_cran.so: Mach-O 64-bit x86_64 dynamically linked shared library, flags:<NOUNDEFS|DYLDLINK|TWOLEVEL|WEAK_DEFINES|BINDS_TO_WEAK|NO_REEXPORTED_DYLIBS|HAS_TLV_DESCRIPTORS>
arrow_ppm.so: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, BuildID[sha1]=efa1a6bb9cc2686f83c1e21b3e6ded56cf73c7b5, stripped
The failing source build is likely #38777 which I still have to investigate
I've been running into this issue on my M2 Mac as well when I use renv, and have been using 13.0.0.1 for the time being. Just wanted to confirm that I was able to install and use 14.0.0.2 using CRAN. In the console I ran:
renv::install("arrow", repos = "https://cloud.r-project.org/", rebuild = TRUE)
and the package loaded normally afterwards.
We believe we've now fixed this for arrow 14.0.0.2 in Package Manager. Older arrow versions with the issue haven't been rebuilt yet, but we'll get those fixed soon as well.
@sj-io If you're able to reinstall that arrow binary from Package Manager, could you provide the output of running packageDescription("arrow")
in R?
@glin I believe it's working. I removed the package and uninstalled/reinstalled a couple different ways (including using repos = "https://packagemanager.posit.co/cran/latest"
, a regular install with no conditions, and installing inside and outside of an renv package) and didn't run into any issues when I tried to render pages that use arrow.
> packageDescription("arrow")
Package: arrow
Title: Integration to 'Apache' 'Arrow'
Version: 14.0.0.2
Authors@R: c( person("Neal", "Richardson", email =
"neal.p.richardson@gmail.com", role = c("aut")),
person("Ian", "Cook", email = "ianmcook@gmail.com",
role = c("aut")), person("Nic", "Crane", email =
"thisisnic@gmail.com", role = c("aut", "cre")),
person("Dewey", "Dunnington", role = c("aut"), email =
"dewey@fishandwhistle.net", comment = c(ORCID =
"0000-0002-9415-4582")), person("Romain",
"Fran\u00e7ois", role = c("aut"), comment = c(ORCID =
"0000-0002-2444-4226")), person("Jonathan", "Keane",
email = "jkeane@gmail.com", role = c("aut")),
person("Drago\u0219", "Moldovan-Gr\u00fcnfeld", email =
"dragos.mold@gmail.com", role = c("aut")),
person("Jeroen", "Ooms", email = "jeroen@berkeley.edu",
role = c("aut")), person("Jacob", "Wujciak-Jens", email
= "jacob@wujciak.de", role = c("aut")),
person("Javier", "Luraschi", email =
"javier@rstudio.com", role = c("ctb")), person("Karl",
"Dunkle Werner", email =
"karldw@users.noreply.github.com", role = c("ctb"),
comment = c(ORCID = "0000-0003-0523-7309")),
person("Jeffrey", "Wong", email =
"jeffreyw@netflix.com", role = c("ctb")),
person("Apache Arrow", email = "dev@arrow.apache.org",
role = c("aut", "cph")) )
Description: 'Apache' 'Arrow' <https://arrow.apache.org/> is a
cross-language development platform for in-memory data.
It specifies a standardized language-independent
columnar memory format for flat and hierarchical data,
organized for efficient analytic operations on modern
hardware. This package provides an interface to the
'Arrow C++' library.
Depends: R (>= 3.4)
License: Apache License (>= 2.0)
URL: https://github.com/apache/arrow/,
https://arrow.apache.org/docs/r/
BugReports: https://github.com/apache/arrow/issues
Encoding: UTF-8
Language: en-US
SystemRequirements: C++17; for AWS S3 support on Linux,
libcurl and openssl (optional)
Biarch: true
Imports: assertthat, bit64 (>= 0.9-7), glue, methods, purrr,
R6, rlang (>= 1.0.0), stats, tidyselect (>= 1.0.0),
utils, vctrs
RoxygenNote: 7.2.3
Config/testthat/edition: 3
Suggests: blob, curl, cli, DBI, dbplyr, decor, distro, dplyr,
duckdb (>= 0.2.8), hms, jsonlite, knitr, lubridate,
pillar, pkgload, reticulate, rmarkdown, stringi,
stringr, sys, testthat (>= 3.1.0), tibble, tzdb, withr
LinkingTo: cpp11 (>= 0.4.2)
Collate: 'arrowExports.R' 'enums.R' 'arrow-object.R' 'type.R'
.....
NeedsCompilation: yes
Packaged: 2023-12-01 18:37:34 UTC; jwj
Author: Neal Richardson [aut], Ian Cook [aut], Nic Crane [aut,
cre], Dewey Dunnington [aut]
(<https://orcid.org/0000-0002-9415-4582>), Romain
François [aut]
(<https://orcid.org/0000-0002-2444-4226>), Jonathan
Keane [aut], Dragoș Moldovan-Grünfeld [aut], Jeroen
Ooms [aut], Jacob Wujciak-Jens [aut], Javier Luraschi
[ctb], Karl Dunkle Werner [ctb]
(<https://orcid.org/0000-0003-0523-7309>), Jeffrey Wong
[ctb], Apache Arrow [aut, cph]
Maintainer: Nic Crane <thisisnic@gmail.com>
Repository: RSPM
Date/Publication: 2023-12-02 01:30:03 UTC
Built: R 4.3.0; x86_64-pc-linux-gnu; 2024-01-03 00:08:18 UTC;
unix
When I load it outside of a project with renv it lists "Repository: CRAN".
@sj-io Thanks for confirming that.
We've also now rebuilt arrow with the fix for 14.0.0 and 14.0.0.1, so installing these older versions should work as well.
Sorry, but I still get errors (I think is the same as before). Am I doing something wrong?
I tried uninstalled previous version before installing the new one, but with no luck either.
> install.packages("arrow")
Installing package into ‘/Users/user/.local/R_libs’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/arrow_14.0.0.2.tar.gz'
Content type 'application/x-gzip' length 4263864 bytes (4.1 MB)
==================================================
downloaded 4.1 MB
* installing *source* package ‘arrow’ ...
** package ‘arrow’ successfully unpacked and MD5 sums checked
** using staged installation
*** pkg-config found.
*** Trying Arrow C++ found by pkg-config: /opt/homebrew/Cellar/apache-arrow/15.0.0
**** Not using: C++ library version (15.0.0) does not match R package (14.0.0.2)
*** Found libcurl and OpenSSL >= 3.0.0
*** Successfully retrieved libarrow (darwin-arm64-openssl-3.0)
*** Checksum validated successfully for libarrow: darwin-arm64-openssl-3.0/arrow-14.0.0.zip
[...]
installing to /Users/user/.local/R_libs/00LOCK-arrow/00new/arrow/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 from temporary location
Error: package or namespace load failed for ‘arrow’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Users/user/.local/R_libs/00LOCK-arrow/00new/arrow/libs/arrow.so':
dlopen(/Users/user/.local/R_libs/00LOCK-arrow/00new/arrow/libs/arrow.so, 0x0006): symbol not found in flat namespace '__ZN5arrow2fs10GcsOptions15FromAccessTokenERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS2_6chrono10time_pointINSB_12system_clockENSB_8durationIxNS2_5ratioILl1ELl1000000000EEEEEEE'
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/Users/user/.local/R_libs/arrow’
Warning in install.packages :
installation of package ‘arrow’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/24/dq2wn8216jv17zwrzgsnxndw0000gn/T/RtmpbPRmzF/downloaded_packages’
I think there are two different issues in this thread, one about installing arrow from source on Homebrew R, and one about installing the precompiled arrow package binaries from Posit Package Manager (https://packagemanager.posit.co/cran/latest).
We've addressed the issues with installing precompiled arrow from Posit Package Manager, but I don't think there was a resolution with installing arrow from Homebrew R.
I'm not sure what the Homebrew issue may be, but @juanfcocontreras you can try installing arrow from https://packagemanager.posit.co/cran/latest instead of https://cran.rstudio.com/. CRAN binary packages on macOS typically aren't compatible with Homebrew R, but the Package Manager binary packages may happen to work on Homebrew R.
Hello @glin ,
Thank you very much for your detailed reply, I wasn't aware of it, until now (and until version 13 of arrow) everything was working correctly from CRAN.
I just tried to install from packagemanager.postit:
install.packages('arrow', repos = "https://packagemanager.posit.co/cran/latest")
But I'm still getting errors. Did I do something wrong or it just doesn't work from pacakgemanager either?
> install.packages('arrow', repos = "https://packagemanager.posit.co/cran/latest")
Installing package into ‘/Users/user/.local/R_libs’
(as ‘lib’ is unspecified)
trying URL 'https://packagemanager.posit.co/cran/latest/src/contrib/arrow_14.0.0.2.tar.gz'
Content type 'binary/octet-stream' length 4267835 bytes (4.1 MB)
==================================================
downloaded 4.1 MB
* installing *source* package ‘arrow’ ...
** package ‘arrow’ successfully unpacked and MD5 sums checked
** using staged installation
[...]
installing to /Users/user/.local/R_libs/00LOCK-arrow/00new/arrow/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 from temporary location
Error: package or namespace load failed for ‘arrow’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Users/user/.local/R_libs/00LOCK-arrow/00new/arrow/libs/arrow.so':
dlopen(/Users/user/.local/R_libs/00LOCK-arrow/00new/arrow/libs/arrow.so, 0x0006): symbol not found in flat namespace '__ZN5arrow2fs10GcsOptions15FromAccessTokenERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS2_6chrono10time_pointINSB_12system_clockENSB_8durationIxNS2_5ratioILl1ELl1000000000EEEEEEE'
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/Users/user/.local/R_libs/arrow’
Warning in install.packages :
installation of package ‘arrow’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/24/dq2wn8216jv17zwrzgsnxndw0000gn/T/RtmpTk6Cx1/downloaded_packages’
@juanfcocontreras Sorry, I forgot that Homebrew R has binary package installation disabled entirely, not just from CRAN, so trying to install binaries from Posit Package Manager won't work out of the box either. That is still attempting a source installation where R tries to compile arrow, rather than installing the precompiled binary from Package Manager.
I'd recommend switching to the R installation from CRAN if possible, rather than Homebrew, as you'll have a much better package installation experience in general, being able to use all of CRAN's precompiled packages.
If that's not feasible, I think it may still be possible to force a binary package installation on Homebrew R, but it's not straightforward. You can install directly from the binary files using:
install.packages("https://packagemanager.posit.co/cran/latest/bin/macosx/big-sur-arm64/contrib/4.3/arrow_14.0.0.2.tgz", repos = NULL)
Where you can find the binary package file URL from the Package Manager website, for a given R version and macOS arch (x86 or arm64): https://packagemanager.posit.co/client/#/repos/cran/packages/overview?search=arrow. This example is for R 4.3, macOS arm64.
This method won't install dependencies by default, so you'll have to individually install each dependency manually.
For why Homebrew R isn't compatible with CRAN, here is some background: https://stat.ethz.ch/pipermail/r-sig-mac/2016-March/011890.html
I forgot that Homebrew R has binary package install disabled oO TIL
@juanfcocontreras I am going to close this issue as the actual matter is closed (Thanks for that and the brew help too @glin!)
As @glin said homebrew R is not recommended for arrow specifically and also overall ;) If you want the ease of a packagemanager to update and switch R versions I would highly recommend https://github.com/r-libs/rig!
You can of course open another issue if the problems persists after following the suggestions :)
Just as a side note, while Homebrew's R formula has the issues mentioned above, the Cask version works great (it's just the CRAN .pkg
installer), so saying homebrew's R isn't recommended isn't quite right since Homebrew is great at managing the CRAN version of R.
So while this gives you a problematic version of R:
brew install r
This gives you the CRAN version of R:
brew install --cask r
And comes with the benefit that Homebrew will automatically upgrade it for you when you run brew upgrade
.
Thank you so much for the suggestion! It's working great!!
Just as a side note, while Homebrew's R formula has the issues mentioned above, the Cask version works great (it's just the CRAN
.pkg
installer), so saying homebrew's R isn't recommended isn't quite right since Homebrew is great at managing the CRAN version of R.So while this gives you a problematic version of R:
brew install r
This gives you the CRAN version of R:
brew install --cask r
And comes with the benefit that Homebrew will automatically upgrade it for you when you run
brew upgrade
.
I have had success with the --cask method from @juanfcocontreras and @amoeba. Thank you. I did have to remove the previous "formula"-based homebrew install of R before arrow would properly install. After that it worked great.
Describe the bug, including details regarding any error messages, version, and platform.
Hi there - I am trying to install the R package arrow on my Mac OS M1.
I have tried to re-install the apache-arrow library with home brew and multiple other solution I read from different github and stackoverflow issue but it still does not solve the issue.
Could you help me out there?
Here is the log below:
Component(s)
R