r-spatial / RQGIS3

GNU Lesser General Public License v3.0
69 stars 19 forks source link

RQGIS3 on windows 10 python3 error #1

Closed coreysparks closed 5 years ago

coreysparks commented 5 years ago

I just installed QGIS3 from OSGeo4w, and can get set_env() to work:

$root [1] "C:/OSGeo4W64"

$qgis_prefix_path [1] "C:/OSGeo4W64/apps/qgis"

$python_plugins [1] "C:/OSGeo4W64/apps/qgis/python/plugins"

but when I try to get the algorithm information, I get a python3 error:

get_usage(alg = "native:centroids") Error in python_config(python_version, required_module, python_version, : Error 1033 occurred running C:/OSGeo4W64/bin/python3.exe In addition: Warning messages: 1: In system2(command = python, args = paste0("\"", config_script, : running command '"C:/OSGeo4W64/bin/python3.exe" "C:/Users/ozd504/R/win-library/3.5/reticulate/config/config.py"' had status 1033 2: In system2(command = python, args = paste0("\"", config_script, : running command '"C:/OSGeo4W64/bin/python3.exe" "C:/Users/ozd504/R/win-library/3.5/reticulate/config/config.py"' had status 1033

Here's my sessioninfo: sessionInfo() R version 3.5.1 (2018-07-02) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] RQGIS3_1.0.1.9000 reticulate_1.9 RevoUtils_11.0.1 RevoUtilsMath_11.0.0

loaded via a namespace (and not attached): [1] Rcpp_0.12.18 rstudioapi_0.7 magrittr_1.5 raster_2.6-7 units_0.6-0
[6] hms_0.4.2 lattice_0.20-35 R6_2.2.2 rlang_0.2.1 stringr_1.3.1
[11] tools_3.5.1 parallel_3.5.1 rgdal_1.3-3 grid_3.5.1 e1071_1.7-0
[16] DBI_1.0.0 class_7.3-14 yaml_2.2.0 tibble_1.4.2 crayon_1.3.4
[21] sf_0.6-3 Matrix_1.2-14 spData_0.2.9.0 readr_1.1.1 sp_1.3-1
[26] stringi_1.2.4 compiler_3.5.1 pillar_1.3.0 classInt_0.2-3 jsonlite_1.5
[31] pkgconfig_2.0.1

jannes-m commented 5 years ago

This was because the Python interpreter was changed from Python36 to Python37 in the latest OSGeo4W update. Should work now again, I have tested a few native, saga, and grass functions.

Note to myself: replace the hard-coded paths to the Python binaries by the paths found in py3_env.bat.

coreysparks commented 5 years ago

Thank you