I am trying to use keras library installed in Winpython version 3.4.4.amd64 in RStudio (via reticulate and kerasR libraries). I work on windows 7 64bit machine. I also tried the same with Winpython version 3.6.1.amd64
What I have tried in R:
# diagnostics
library(reticulate) 
# reticulate::use_python("PATH_TO_PYTHON") 
path_to_python <- "C:\\dev\\WinPython3.4\\python-3.4.4.amd64"
use_python(path_to_python) 
py_module_available("keras")
[1] FALSE               # it responds with TRUE for eg. matplotlib
py_config()
# python:         C:\dev\WinPython3.4\python-3.4.4.amd64/python.exe
# libpython:      C:/dev/WinPython3.4/python-3.4.4.amd64/python34.dll
# pythonhome:     C:\dev\WINPYT~1.4\PYTHON~1.AMD
# version:        3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 20:20:57) [MSC # v.1600 64 bit (AMD64)]
# Architecture:   64bit
# numpy:          C:\dev\WINPYT~1.4\PYTHON~1.AMD\lib\site-packages\numpy
# numpy_version:  1.11.3
When I use Spyder IDE and load keras, it does not throw errors at me. Earlier I took care to modify .keras json file to use theano and not tensorflow.
When I try other libs, eg py_module_available("theano") I get TRUE.
I have no idea what I miss here. I would like to use keras with library(kerasR). I am at work and cannot modify registry and environment paths. Would it be the reason?
When I try
reticulate::import("keras")
I get:
Error in py_module_import(module, convert = convert) : 
  AttributeError: 'NoneType' object has no attribute 'write'
Detailed traceback: 
  File "C:\dev\WINPYT~1.4\PYTHON~1.AMD\lib\site-packages\keras\__init__.py", line 2, in <module>
    from . import backend
  File "C:\dev\WINPYT~1.4\PYTHON~1.AMD\lib\site-packages\keras\backend\__init__.py", line 66, in <module>
    sys.stderr.write('Using TensorFlow backend.\n')
I tried the same for 3.6.1.amd64 with the same result. I am out of ideas, tkanks very much for all suggestions.
 
     
    