Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not install devtools in R4.4.1 #2567

Closed
BenxiaHu opened this issue Jul 15, 2024 · 4 comments
Closed

can not install devtools in R4.4.1 #2567

BenxiaHu opened this issue Jul 15, 2024 · 4 comments
Labels
reprex needs a minimal reproducible example

Comments

@BenxiaHu
Copy link

can not install devtools in R4.4.1

@jennybc
Copy link
Member

jennybc commented Jul 15, 2024

I can.

> R.version.string
[1] "R version 4.4.1 (2024-06-14)"
> install.packages("devtools")
Installing package into '/Users/jenny/Library/R/arm64/4.4/library'
(as 'lib' is unspecified)
trying URL '[https://p3m.dev/cran/latest/bin/macosx/big-sur-arm64/contrib/4.4/devtools_2.4.5.tgz](vscode-file://vscode-app/Users/jenny/rrr/positron/out/vs/code/electron-sandbox/workbench/workbench-dev.html#)'
Content type 'binary/octet-stream' length 437353 bytes (427 KB)
=====================================
downloaded 427 KB


The downloaded binary packages are in
	/tmp/RtmpMGyMdU/downloaded_packages
> library(devtools)

So you're going to need to provide more detail.

@jennybc jennybc added the reprex needs a minimal reproducible example label Jul 15, 2024
@BenxiaHu
Copy link
Author

BenxiaHu commented Jul 15, 2024

here is the error

x86_64-conda-linux-gnu-ar rcs agg/libstatagg.a agg/src/agg_curves.o agg/src/agg_font_freetype.o agg/src/agg_image_filters.o agg/src/agg_trans_affine.o agg/src/agg_vcgen_dash.o agg/src/agg_vcgen_stroke.o
x86_64-conda-linux-gnu-c++ -std=gnu++17 -shared -L/anaconda3/envs/R4.4/lib/R/lib -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,--allow-shlib-undefined -Wl,-rpath,/anaconda3/envs/R4.4/lib -Wl,-rpath-link,/anaconda3/envs/R4.4/lib -L/anaconda3/envs/R4.4/lib -o ragg.so capture_dev.o init.o jpeg_dev.o png_dev.o ppm_dev.o tiff_dev.o -Lagg -lstatagg -lfreetype -lpng15 -ltiff -ljpeg -L/anaconda3/envs/R4.4/lib/R/lib -lR
/anaconda3/envs/R4.4/bin/../lib/gcc/x86_64-conda-linux-gnu/14.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: cannot find -lpng15: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [/anaconda3/envs/R4.4/lib/R/share/make/shlib.mk:10: ragg.so] Error 1
ERROR: compilation failed for package ‘ragg’

  • removing ‘/anaconda3/envs/R4.4/lib/R/library/ragg’
    ERROR: dependency ‘gert’ is not available for package ‘usethis’
  • removing ‘/anaconda3/envs/R4.4/lib/R/library/usethis’
    ERROR: dependency ‘ragg’ is not available for package ‘pkgdown’
  • removing ‘/anaconda3/envs/R4.4/lib/R/library/pkgdown’
    ERROR: dependencies ‘usethis’, ‘pkgdown’ are not available for package ‘devtools’
  • removing ‘/anaconda3/envs/R4.4/lib/R/library/devtools’

The downloaded source packages are in
‘/tmp/RtmpKj1bWN/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning messages:
1: In install.packages("devtools") :
installation of package ‘gert’ had non-zero exit status
2: In install.packages("devtools") :
installation of package ‘ragg’ had non-zero exit status
3: In install.packages("devtools") :
installation of package ‘usethis’ had non-zero exit status
4: In install.packages("devtools") :
installation of package ‘pkgdown’ had non-zero exit status
5: In install.packages("devtools") :
installation of package ‘devtools’ had non-zero exit status

thanks.

@jennybc
Copy link
Member

jennybc commented Jul 16, 2024

If you use conda, you need to install all of your packages from conda because they use a different toolchain than CRAN (the official distribution of R and contributed packages).

/anaconda3/envs/R4.4/bin/../lib/gcc/x86_64-conda-linux-gnu/14.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: cannot find -lpng15: No such file or directory

Does your system have the PNG15 library available?

Overall, it sounds like you're (unintentionally?) trying to mix a conda-managed R installation with also installing packages from CRAN / from source, which generally does not go well.

@philibe
Copy link

philibe commented Jul 17, 2024

In R version 4.4.1 (2024-06-14, x86_64-pc-linux-gnu) I had errors during usage and re-install of devtools:

install.packages("devtools")
Installing package into/usr/local/lib/R/site-library’
(aslibis unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/devtools_2.4.5.tar.gz'
Content type 'application/x-gzip' length 374718 bytes (365 KB)
==================================================
downloaded 365 KB

* installing *source* packagedevtools...
** packagedevtoolssuccessfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error: .onLoad failed in loadNamespace() for 'pkgload', details:
  call: .make_numeric_version(x, strict, .standard_regexps()$valid_numeric_version)
  error: invalid non-character version specification 'x' (type: double)
Execution halted
ERROR: lazy loading failed for packagedevtools* removing/usr/local/lib/R/site-library/devtoolsWarning in install.packages :
  installation of packagedevtoolshad non-zero exit status

The downloaded source packages are in/tmp/RtmpbYWTeU/downloaded_packages

I 've launched pak::pak("devtools"), like @hadley said there in #2566, and after after I've read errors:

  • sudo apt-get install libcurl4-openssl-dev libgit2-dev
  • install.packages("pkgload"), reinstall, because of .onLoad failed in loadNamespace() for 'pkgload' below.

And install.packages("devtools") and the usage of devtools work now with R version 4.4.1 :)

Found when I am trying to play with rextendr::document(), from https://cran.r-project.org/web/packages/rextendr/vignettes/package.html, which gave me the same error at the line devtools::r_env_vars() inside rextendr::document().

I have Anaconda but I use normal CRAN installation for R.

My post is only to give some others symptoms and tries because for me also "it sounds like you're (unintentionally?) trying to mix a conda-managed R installation with also installing packages from CRAN / from source, which generally does not go well."

@hadley hadley closed this as completed Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reprex needs a minimal reproducible example
Projects
None yet
Development

No branches or pull requests

4 participants