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

Errors when trying to install #1

Closed
sbuis opened this issue Dec 4, 2019 · 2 comments
Closed

Errors when trying to install #1

sbuis opened this issue Dec 4, 2019 · 2 comments

Comments

@sbuis
Copy link
Member

sbuis commented Dec 4, 2019

Issue Name

Errors when trying to install

Expected Behavior

Installation of SticsRpacks packages and dependent packages

Current Behavior

Each time a dependent package is tried to be installed the process stopped with an error.

Failure Information (for bugs)

Example:

R code:

devtools::install_github("SticsRPacks/SticsRPacks")

Output:

Enter one or more numbers, or an empty line to skip updates:
1

package******successfully unpacked and MD5 sums checked
Error: Failed to install 'SticsRPacks' from GitHub:
(converted from warning) cannot remove prior installation of package*****

Context

  • R version: 3.5.0
  • RStudio version: 1.2.5001
  • OS: Windows10
  • Package dependencies version:
@VEZY
Copy link
Member

VEZY commented Dec 8, 2019

These errors do not come from the SticsRPacks package, but from RStudio. It is a rather known issue for other packages (such as tidyverse). The problem is stated in the error: "cannot remove prior installation of package ‘*****’" means that R couldn't delete the current version of the package so it couldn't install the new one at the same place.

The work-arounds can be to:

  • Terminate all R sessions running, including the one you are using right now because:

    • if R is running elsewhere and uses the package, a lock is placed on its folder so nothing can delete it;
    • the state of the session you are using could be retreived from the previous session (terminate from the Session tab -> Terminate R);
      Then retry devtools::install_github("SticsRPacks/SticsRPacks")
  • If the previous answer didn't work, install the package ‘*****’ named at the end of the error message manually, e.g. install.packages("*******"), and see what is the output of the installation. If it works, you can proceed with the installation of SticsRPacks, if not, try to delete the previous installation manually from your library (you can find the path using .libPaths()).

  • If the error of installation concerns one of our own packages, the error arise from the package itself, not from SticsRPacks. So open an issue on the package repo directly. Of course test by yourself to install it directly (e.g. devtools::install_github("SticsRPacks/SticsOnR")) before. Or you can also try to build it yourself from the code to check for the errors.

Hope it helps!

@VEZY VEZY closed this as completed Dec 8, 2019
@VEZY
Copy link
Member

VEZY commented Jan 6, 2023

Update from the future:
Alternatively, you can use {pak} instead of of {devtools}, and it will probably work better for the installation.

install.packages("pak")

As of today (2023-01-06) the cran version of {pak} does not support well subdirectories though, which is problematic for Bayesian tools that has its package in a subdir.

So you'll have to install the "release candidate" version of pak instead:

pak::pak_update(stream = "rc", force = TRUE)

Then use pak to install {SticsRPacks} like so:

pak::pkg_install("SticsRPacks/SticsRPacks")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants