-
Notifications
You must be signed in to change notification settings - Fork 2
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
Deepforest installation fail : A GDAL API version must be specified. #2
Comments
Thanks @PPierre22 for reporting this issue, let me try to locate the problem. At the moment, could you try some of these checks |
Thank you @henrykironde for your prompt reply. Check 1 : use_condaenv("r-reticulate") FYI, I have 2 conda environments:
Using the second one with use_condaenv("r-reticulate") do not change the problem. Check 2 : make sure that your PATH Environment variable has the paths "C:/Users/.../AppData/Local/r-miniconda/envs/r-reticulate" and C:/Users/.../AppData/Local/r-miniconda/envs/r-reticulate/ {path to site packages} My current paths are : > Sys.getenv("PATH") I figure the second path you mention is not here, but I’m not sure how to interpret what you mean by “{path to site packages}”. In any cases, I added the following path: C:\Users\…\AppData\Local\r-miniconda\envs\r-reticulate\Lib\site-packages; It did not solve the problem. Also, I think that R already found this path, since each time I try to re-install DeepForest it does mention this path: > reticulate::py_install('DeepForest', pip=TRUE) # Install the Python retriever package |
I can replicate the issue (sorry @PPierre22 we haven't been testing on Windows yet). I believe the following change will properly install on Windows (as long as RTools is installed): install.packages('reticulate') # Install R package for interacting with Python
reticulate::install_miniconda() # Install Python
reticulate::py_install(c('gdal', 'rasterio', 'fiona')) # Install spatial dependencies via conda
reticulate::py_install('DeepForest', pip=TRUE) # Install the Python retriever package
devtools::install_github('weecology/deepforestr') # Install the R package for running the retriever @PPierre22 - can you see if this fixes things for you? @henrykironde - you're probably onto this already, but it's a problem with getting |
Hi @ethanwhite, |
It's not on CRAN yet, that was a typo in the original instructions. If you use the last line in the code block above you should be able to install it straight from the repository as long as you have RTools installed. |
The install worked - thanks! |
Awesome! We're still very much in the early development phase here so definitely let us know if you run into more issues as you. |
Hi,
When i attempt to install Deepforest using :
reticulate::py_install('DeepForest', pip=TRUE) # Install the Python retriever package
the following error message is repeated many times, and the installation fails :
INFO:root:Building on Windows requires extra options to setup.py to locate needed GDAL files. More information is available in the README.
ERROR: A GDAL API version must be specified. Provide a path to gdal-config using a GDAL_CONFIG environment variable or use a GDAL_VERSION environment variable.
I tried changing the conda environment to make sure it correspond to the one generated by "reticulate::install_miniconda() " using "use_condaenv()" but it does not seem to be the issue.
I also re-installed GDAL via the Anaconda prompt using "conda install -c conda-forge gdal", restarded the computer, re-installed rgdal (from source), restarted R, did not change a thing.
Any idea what may be the issue?
Hereafter a few info on my system:
> sessionInfo()
_R version 4.0.3 (2020-10-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)
Matrix products: default
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] forcats_0.5.0 stringr_1.4.0 dplyr_1.0.2 purrr_0.3.4 readr_1.4.0 tidyr_1.1.2 tibble_3.0.4 ggplot2_3.3.2 tidyverse_1.3.0
[10] reticulate_1.22 rgdal_1.5-27 sp_1.4-4
loaded via a namespace (and not attached):
[1] tidyselect_1.1.0 haven_2.3.1 lattice_0.20-41 colorspace_2.0-0 vctrs_0.3.5 generics_0.1.0 rlang_0.4.8 pillar_1.4.7
[9] glue_1.4.2 withr_2.3.0 DBI_1.1.0 rappdirs_0.3.1 dbplyr_2.0.0 modelr_0.1.8 readxl_1.3.1 lifecycle_0.2.0
[17] munsell_0.5.0 gtable_0.3.0 cellranger_1.1.0 rvest_0.3.6 fansi_0.4.1 broom_0.7.2 Rcpp_1.0.7 scales_1.1.1
[25] backports_1.2.0 jsonlite_1.7.1 fs_1.5.0 hms_0.5.3 png_0.1-7 stringi_1.5.3 grid_4.0.3 rprojroot_2.0.2
[33] here_1.0.0 cli_2.2.0 tools_4.0.3 magrittr_2.0.1 crayon_1.3.4 pkgconfig_2.0.3 ellipsis_0.3.1 Matrix_1.2-18
[41] xml2_1.3.2 reprex_0.3.0 lubridate_1.7.9.2 assertthat_0.2.1 httr_1.4.2 rstudioapi_0.13 R6_2.5.0 compiler_4.0.3_
> py_config()
python: C:/Users/.../AppData/Local/r-miniconda/envs/r-reticulate/python.exe
libpython: C:/Users/.../AppData/Local/r-miniconda/envs/r-reticulate/python36.dll
pythonhome: C:/Users/.../AppData/Local/r-miniconda/envs/r-reticulate
version: 3.6.13 (default, Sep 23 2021, 07:38:49) [MSC v.1916 64 bit (AMD64)]
Architecture: 64bit
numpy: C:/Users/.../AppData/Local/r-miniconda/envs/r-reticulate/Lib/site-packages/numpy
numpy_version: 1.19.5
The text was updated successfully, but these errors were encountered: