I am currently using
R ver. 3.4.1 installed on C:\R\R-3.4.1,
installed and loaded Packages:
QGIS ver. 2.18.11 installed with OSGeo installer on C:\OSGeo4W64\apps\qgis.
In R I am trying to use the installed RQGIS package to enable QGIS functions via R as shown in the example of the packages GitHub page (https://github.com/jannes-m/RQGIS), I was following.
My environment is set to:
set_env() $root  "C:\\OSGeo4W64" $qgis_prefix_path  "C:\\OSGeo4W64\\apps\\qgis" $python_plugins  "C:\\OSGeo4W64\\apps\\qgis\\python\\plugins"
But unfortunately I always get errors at the following line of code:
library("RQGIS") find_algorithms(search_term = "([Pp]olygon)(centroid)") Error in py_str_impl(object) : UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 77807: ordinal not in range(128) Error in py_call_impl(callable, dots$args, dots$keywords) : AttributeError: 'file' object has no attribute 'getvalue' Detailed traceback: File "C:/R/library/reticulate/python\rpytools\output.py", line 14, in end_stdout_capture output = sys.stdout.getvalue()
I have already tried reinstalling QGIS, R and all depending packages for a couple of times.
Now I checked Spacedman's suggestions, see below.
> reticulate::py_config() python: C:\OSGeo4W64\bin\python.exe libpython: C:/OSGeo4W64/bin/python27.dll pythonhome: C:\OSGeo4W64\apps\Python27 version: 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)] Architecture: 64bit numpy: C:\OSGeo4W64\apps\Python27\lib\site-packages\numpy. numpy_version: 1.12.1 python versions found: C:\OSGeo4W64\bin\python.exe C:\OSGEO4~1\bin\python.exe
And in QGIS I entered:
import sys sys.executable 'C:\\OSGEO4~1\\bin\\qgis-bin.exe'
Unfortunately I still don't know how to get it up running correctly.