VAST icon indicating copy to clipboard operation
VAST copied to clipboard

Error using devtools::install_github("james-thorson/VAST")

Open Mahdi2022 opened this issue 6 years ago • 9 comments

I tried to install the new version of the VAST package and FishstatsUtils in Rstudio1.1.453 with the following code, but I got the error message:

devtools::install_github("james-thorson/VAST") Error: package or namespace load failed for 'FishStatsUtils': .onAttach failed in attachNamespace() for 'FishStatsUtils', details: call: contrib.url(repos, "source") error: trying to use CRAN without setting a mirror Error: loading failed Execution halted *** arch - x64 Error: package or namespace load failed for 'FishStatsUtils': .onAttach failed in attachNamespace() for 'FishStatsUtils', details: call: contrib.url(repos, "source") error: trying to use CRAN without setting a mirror Error: loading failed Execution halted ERROR: loading failed for 'i386', 'x64'

  • removing 'C:/Program Files/R/R-3.5.2/library/FishStatsUtils' In R CMD INSTALL Error in i.p(...) : (converted from warning) installation of package ‘C:/Users/MAMINI~1/AppData/Local/Temp/RtmpINSOi7/file1c24761c798/FishStatsUtils_1.0.0.tar.gz’ had non-zero exit status In addition: Warning messages: 1: In untar2(tarfile, files, list, exdir) : skipping pax global extended headers 2: In untar2(tarfile, files, list, exdir) : skipping pax global extended headers 3: In untar2(tarfile, files, list, exdir) : skipping pax global extended headers 4: In untar2(tarfile, files, list, exdir) : skipping pax global extended headers 5: In untar2(tarfile, files, list, exdir) : skipping pax global extended headers 6: In untar2(tarfile, files, list, exdir) : skipping pax global extended headers 7: In untar2(tarfile, files, list, exdir) : skipping pax global extended headers 8: In untar2(tarfile, files, list, exdir) : skipping pax global extended headers I also used R 3.5.2 in my computer. Although I have tried to install VAST and FishStatsUtils in several computers, none of them did not work.

Thank you!

Mahdi2022 avatar Jan 21 '19 16:01 Mahdi2022

please try installing FishStatsUtils via:

install_github( "james-thorson/FishStatsUtils", ref="test" )

and report back

James-Thorson avatar Jan 21 '19 17:01 James-Thorson

please try installing FishStatsUtils via:

install_github( "james-thorson/FishStatsUtils", ref="test" )

and report back

James-Thorson avatar Jan 21 '19 17:01 James-Thorson

Now I got this error message:

install_github("james-thorson/VAST", ref="test") Error: HTTP error 401. Bad credentials

Rate limit remaining: 57/60 Rate limit reset at: 2019-01-22 13:20:50 UTC

install_github("james-thorson/FishStatsUtils", ref="test") Error: HTTP error 401. Bad credentials

Rate limit remaining: 56/60 Rate limit reset at: 2019-01-22 13:20:50 UTC

Mahdi2022 avatar Jan 22 '19 12:01 Mahdi2022

And I also have got the error message as following in another version of R 3.5.1:**

install_github("james-thorson/VAST", ref="test") Using GitHub PAT from envvar GITHUB_PAT Downloading GitHub repo james-thorson/VAST@test from URL https://api.github.com/repos/james-thorson/VAST/zipball/test Installation failed: Bad credentials (401)

Mahdi2022 avatar Jan 22 '19 14:01 Mahdi2022

I have tried the code that you mentioned. but I got this error:

install_github("james-thorson/FishStatsUtils", ref="test") Using GitHub PAT from envvar GITHUB_PAT Downloading GitHub repo james-thorson/FishStatsUtils@test from URL https://api.github.com/repos/james-thorson/FishStatsUtils/zipball/test Installation failed: Bad credentials (401)

Mahdi2022 avatar Jan 22 '19 16:01 Mahdi2022

This appears to be some problem specific to devtools and your machine. I'm happy to explore a bit with you, but ultimately imagine that it will require someone more experienced with devtools to know what's happening. Perhaps also try googling and exploring that way.

In the meantime, could you try installing all dependencies and then re-try the test version:

  if( !"INLA" %in% utils::installed.packages()[,1] ){
    packageStartupMessage("Installing package: INLA...")
    #utils::install.packages("INLA", repos="
https://www.math.ntnu.no/inla/R/stable")
    utils::install.packages("INLA", repos=c(getOption("repos"), INLA="
https://inla.r-inla-download.org/R/stable"), dep=TRUE)
  }
  packageStartupMessage("Installing dependencies while setting repos...")
  Dep = c(
    "graphics",
    "utils",
    "mapproj",
    "maptools",
    "deldir",
    "PBSmapping",
    "RANN",
    "stats",
    "colorspace",
    "RandomFields",
    "RandomFieldsUtils",
    "shape",
    "devtools",
    "mixtools",
    "sp",
    "maps",
    "mapdata",
    "TMB",
    "MatrixModels",
    "rgdal",
    "abind",
    "corpcor",
    "pander",
    "formatR"
  )
  utils::install.packages( pkgs=Dep, repos='http://cran.us.r-project.org' )
  #if( !"TMB" %in% utils::installed.packages()[,1] ){
  #  packageStartupMessage("Installing TMB...")
  #  devtools::install_github("kaskr/adcomp/TMB")
  #}
  if( !"TMBhelper" %in% utils::installed.packages()[,1] ){
    packageStartupMessage("Installing package: TMBhelper...")
    devtools::install_github("kaskr/TMB_contrib_R/TMBhelper")
  }
  if( !"ThorsonUtilities" %in% utils::installed.packages()[,1] ){
    packageStartupMessage("Installing package: ThorsonUtilities...")
    devtools::install_github("james-thorson/utilities")
  }

devtools::install_github( "james-thorson/FishStatsUtils", ref="test" )

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon Virus-free. www.avast.com https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Tue, Jan 22, 2019, 8:37 AM Mahdi2022 <[email protected] wrote:

I have tried the code that you mentioned. but I got this error:

install_github("james-thorson/FishStatsUtils", ref="test") Using GitHub PAT from envvar GITHUB_PAT Downloading GitHub repo james-thorson/FishStatsUtils@test from URL https://api.github.com/repos/james-thorson/FishStatsUtils/zipball/test Installation failed: Bad credentials (401)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/James-Thorson/VAST/issues/147#issuecomment-456468487, or mute the thread https://github.com/notifications/unsubscribe-auth/AHnqTUZ62yWiwCbDW_oBIaFS6--ajjhgks5vFz5SgaJpZM4aLHeg .

James-Thorson avatar Jan 22 '19 20:01 James-Thorson

SOLUTION

I'm not sure I saw the solution for this when Mahdi2022 asked it. But when you get a bunch of errors related to installing VAST with devtools, something like

call: contrib.url(repos, "source") error: trying to use CRAN without setting a mirror Error: loading failed Execution halted *** arch - x64 Error: package or namespace load failed for 'FishStatsUtils': .onAttach failed in attachNamespace() for 'FishStatsUtils', details: call: contrib.url(repos, "source") error: trying to use CRAN without setting a mirror Error: loading failed Execution halted ERROR: loading failed for 'i386', 'x64'

One solution is as follows, devtools::install_github("james-thorson/vast", INSTALL_opts=c("--no-multiarch --no-test-load"))

You may not need the --no-multiarch flag, but you definitely need the --no-test-load

This problem is not unique to VAST. It is a problem with many github packages and the most recent R version.

Brandon

bchasco avatar Jun 04 '19 04:06 bchasco

I have tried the code that you mentioned. but I got this error:

install_github("james-thorson/FishStatsUtils", ref="test") Using GitHub PAT from envvar GITHUB_PAT Downloading GitHub repo james-thorson/FishStatsUtils@test from URL https://api.github.com/repos/james-thorson/FishStatsUtils/zipball/test Installation failed: Bad credentials (401)

https://github.com/r-lib/devtools/issues/1566#issuecomment-320504796 solved my issue for https://github.com/englianhu/binary.com-interview-question

englianhu avatar Nov 20 '20 18:11 englianhu

# Installation failed: Bad credentials (401)
#when see above error message, then
github_pat(1)
Sys.getenv("GITHUB_PAT")
Sys.unsetenv("GITHUB_PAT")
Sys.getenv("GITHUB_PAT")

🤝🏻 source : https://github.com/r-lib/devtools/issues/1566#issuecomment-320504796

englianhu avatar Jun 05 '21 10:06 englianhu