ocean-tracking-network / glatos

9 stars 4 forks source link

Installation problem #184

Closed JoseAnd03 closed 10 months ago

JoseAnd03 commented 1 year ago

Hello Im having some trouble trying to installated the glatos package on my Mac 10. 15. 7 Catalina and R Studio 4.2.3 Its telling me its impossible to do it because there are some dependecies "ERROR: dependencies ‘gdalUtils’, ‘rgdal’, ‘rgeos’ are not available for package ‘glatos’" Anyone could help me? Thanks in advance

chrisholbrook commented 1 year ago

There could be a couple issues at play here.

  1. Let's make sure you are installing glatos from the correct repository, because mention of "gdalUtils" in the error message suggests you are attempting to install an older version from a different source. gdalUtils has not been required by glatos since glatos version 0.6.0 (current version is 0.6.5). The repository for glatos did change from gitlab to github a few years ago and many people are still finding/using code pointing to the old one. The correct repo is https://github.com/ocean-tracking-network/glatos. To install from there, run the following code in R:

    library(remotes)
    install_github('ocean-tracking-network/glatos', build_vignettes = TRUE)
  2. On Oct. 17, 2023 rgeos, rgdal, and maptools were removed from CRAN (details here: https://r-spatial.org/r/2022/04/12/evolution.html). Unfortunately, glatos still requires two of those packages, which prevents installation on systems lacking those packages. I hope to have this issue resolved by Nov. 3 2023. If this is your issue and you can't wait until then, there are some workarounds (e.g., install the required packages from a different source) that I can point you to (others have reportedly used for glatos specifically), but I haven't yet tried them myself.

    To check if those dependencies are installed on your system, you might run the following code in your R: packageVersion("rgdal")

    packageVersion("rgeos")

    If it returns a version number for each of those, then this is not your problem. If it returns something like "Error in packageVersion("rgdal") : there is no package called ‘rgdal’" then those missing packages will prevent installation of glatos.

JoseAnd03 commented 1 year ago

Ey Chris!! Thank you so much for the help and the feedback!! Im gonna try to see the feedback and try again to install it.. Thanks again!!

chrisholbrook commented 1 year ago

Quick follow up to clarify a question from another user... glatos does not require maptools. Comment above was edited to more clearly show that only rgdal and rgeos are required at this time.

JoseAnd03 commented 1 year ago

Hi Chris Any news on the solution for the instalation process of the glatos packages? Im still tyring but still ask for the dependencies rgdal and rgeos (that i dont have at my computer) Thanks for the info man!

chrisholbrook commented 1 year ago

I have not been able to make progress on this issue yet, sorry. Target date is now Nov 17.

As a workaround, another user (thanks Ben H.) has suggested the following (I have not yet tested):

For windows:

To currently install glatos, considering rgdal and rgeos have been archived, the following workaround works so far on a PC. I have not tested this on other devices/OS.

  1. Download the archived tar.gz file for rgdal and rgeos. When you click the links, scroll all the way down to the bottom and download the latest version.
  2. Install the archived tar.gz packages into R with the following code. You will need to specify the file path to the tar.gz files. For windows OS you may need to have Rtools installed for this.
install.packages("C:\\Users\\Owner\\Downloads\\rgdal_1.6-7.tar.gz", repos = NULL, type = "source")
install.packages("C:\\Users\\Owner\\Downloads\\rgeos_0.6-4.tar.gz", repos = NULL, type = "source")
  1. Install remotes if you don't already have the package
    install.packages("remotes")
  2. Install glatos using the install instructions provided on the github wiki for the package.
    library(remotes) 
    install_github('ocean-tracking-network/glatos', build_vignettes = TRUE)

For mac:

For those installing on a Mac, if the mac does not have gdal then install it using home brew and then I believe follow the steps above will work. You may need to install {geos} using the following

install.packages(
  "geos", 
  type = "source", 
  configure.args = c("--with-proj-lib=/usr/local/lib/", 
                     "--with-proj-include=/usr/local/include/", 
                     "--with-geos-config=/usr/local/bin/geos-config", 
                     "--with-gdal-config=/usr/local/bin/gdal-config"
  )
)
JoseAnd03 commented 1 year ago

Hello Chris First, thank you so much for the reply and the level of detailed on it.. I will review all the information related to the installation of the dependencies on the glatos and try to use it like this... Secondly, no worries, i hope you and your team are able to resolved it... I imagine its not something easy to do... Thanks again

chrisholbrook commented 10 months ago

Fixed in glatos 0.7.0 ("sour-peaches"); commit c6ca9c1f3e540b2ddfbe6e99899b7a09f211405d.