I am trying to use the RQGIS3 package to access QGIS3 functions from R, and although briefly I had things working (mostly), running the following code:
library(RQGIS3)
qgis_env <- set_env("C:/Program Files/QGIS 3.4")
qgis_session_info(qgis_env=qgis_env)</code>
now produces the following error:
Error in py_get_attr_impl(x, name, silent) :
AttributeError: module '__main__' has no attribute 'RQGIS3'
I'm not sure what changed. Another post suggested that the order in which packages were loaded determined whether this error cropped up, but in my case, I have not even loaded any other packages. I am pretty new at using RQGIS(3), and know next to nothing about Python.
I am using QGIS 3.4.7, and R 3.5.0 (I will get out IT staff to upgrade R next week to see if that fixes things).
Any thoughts what else might be going on here?
remotes:::install.github()
throws an error becausereticulate
expects R 3.6.2, even though I specifyR_REMOTES_NO_ERRORS_FROM_WARNINGS="true"
as suggested at <github.com/r-lib/remotes#environment-variables>. I'll report back when I get this resolved.Sys.setenv(R_REMOTES_NO_ERRORS_FROM_WARNINGS=TRUE)
and then QGIS3 installed just fine (mostly). There were some warnings that links to SpatialPointsDataframes (Polygons, Lines) did not exist and were being treated as a topic. I also updated QGIS to 3.4.11 (the latest approved version in our organization) and it made no difference. My operating system is WIndows 10. I have a laptop with Linux Mint, and QGIS 3.4.13, and things seem to work fine over there.native:zonalhistogram
in RStudio as opposed to RGui, and it seems to produce the correct results. But in RStudio a bunch of other warnings appear (Deprecation warnings about invalid escape sequence, and aboutimporting the ABCs from 'collections' instead of from 'collections.abc'
), and there is a warning aboutERROR 4: Unable to open EPSG support file gcs.csv.