Python – tensorflow: [NOT FOUND] error in RStudio

tensorflow: [NOT FOUND] error in RStudio… here is a solution to the problem.

tensorflow: [NOT FOUND] error in RStudio

I tried running the following code in RStudio:

library(tensorflow)

x_data <- runif(100, min=0, max=1)
y_data <- x_data * 0.1 + 0.3

W <- tf$Variable(tf$random_uniform(shape(1L), -1.0, 1.0))

But the last line throws the following error:

Error: Python module tensorflow was not found.

Detected Python configuration:

python:         /usr/bin/python
libpython:      /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/libpython2.7.dylib
pythonhome:     /System/Library/Frameworks/Python.framework/Versions/2.7:/System/Library/Frameworks/Python.framework/Versions/2.7
version:        2.7.10 (default, Oct 23 2015, 19:19:21)  [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)]
numpy:          /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy
numpy_version:  1.8.1
tensorflow:     [NOT FOUND]

This is my

first attempt to incorporate Python into RStudio (in order to access Tensorflow), so I’m not sure what (or where) to check to make sure my setup is appropriate.

Solution

I

realized I had the python 3 version of tensorflow installed instead of the python 2 version, and here is my error message that I am using RStudio. Use the installation instructions found here, I am Python 2 has TensorFlow installed and able to run the above code.

Related Problems and Solutions