Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TensorFlow Installation Error In RStudio #144

Closed
HARIGB opened this issue Jul 1, 2017 · 24 comments

Comments

@HARIGB
Copy link

commented Jul 1, 2017

When I was trying to install TensorFlow, I keep on receiving this error, even though I updated R , Rstudio & R Packages. I was following this procedure in the link https://tensorflow.rstudio.com/installation.html . I was stuck up at the first command itself.

>devtools::install_github("rstudio/tensorflow")
Downloading GitHub repo rstudio/tensorflow@master
from URL https://api.github.com/repos/rstudio/tensorflow/zipball/master
Installing tensorflow
Downloading GitHub repo rstudio/reticulate@master
from URL https://api.github.com/repos/rstudio/reticulate/zipball/master
Error: running command '"C:/PROGRA~1/R/R-33~1.2/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD config CC' had status 127

@jjallaire

This comment has been minimized.

Copy link
Member

commented Jul 1, 2017

I think it might actually be because you don't have R build tools installed. Try installing Rtools from here: https://cran.r-project.org/bin/windows/Rtools/index.html

@HARIGB

This comment has been minimized.

Copy link
Author

commented Jul 1, 2017

Even after installing the Rtools34.exe, I am getting the same error.

> devtools::install_github("rstudio/tensorflow")
Downloading GitHub repo rstudio/tensorflow@master
from URL https://api.github.com/repos/rstudio/tensorflow/zipball/master
Installing tensorflow
Downloading GitHub repo rstudio/reticulate@master
from URL https://api.github.com/repos/rstudio/reticulate/zipball/master
Error: running command '"C:/PROGRA~1/R/R-34~1.1/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD config CC' had status 127
> 
@jjallaire

This comment has been minimized.

Copy link
Member

commented Jul 1, 2017

@HARIGB

This comment has been minimized.

Copy link
Author

commented Jul 1, 2017

Its ok, I'll try at other PC and let you know. Thanks and I felt very awesome for your immediate responses.

@jjallaire

This comment has been minimized.

Copy link
Member

commented Jul 1, 2017

@HARIGB

This comment has been minimized.

Copy link
Author

commented Jul 1, 2017

This is what I found on diagnostics and then realized GIT might have created such a problem and uninstalled it. So, I was able to successfully execute the first line of code. working on, in further steps. Hope hereafter everything should go fine. & here my question will be, what I might have done to resolve this issue,Instead of uninstalling the GIT.

>devtools::find_rtools(debug = TRUE)
Scanning path...
ls : C:\PROGRA~1\Git\usr\bin\ls.exe 
"C:/PROGRA~1/R/R-34~1.1/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD config  \
  CC 

Error: running command '"C:/PROGRA~1/R/R-34~1.1/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD config CC' had status 127

Thanks a lot Allaire

@HARIGB

This comment has been minimized.

Copy link
Author

commented Jul 2, 2017

After using the following codes to install

> library(tensorflow)
> install_tensorflow(method = "auto")

I got the following, Still facing some problems.

Installation of TensorFlow complete.

> library(tensorflow)
> sess<-tf$Session()
Error: Installation of TensorFlow not found.

Python environments searched for 'tensorflow' package:
 C:\ProgramData\Anaconda3\python.exe

You can install TensorFlow using the install_tensorflow() function.
> sess = tf$Session()
Error: Python module tensorflow was not found.

Detected Python configuration:

python:         C:\PROGRA~3\ANACON~1\python.exe
libpython:      C:/PROGRA~3/ANACON~1/python36.dll
pythonhome:     C:\PROGRA~3\ANACON~1
version:        3.6.1 |Anaconda 4.4.0 (64-bit)| (default, May 11 2017, 13:25:24) [MSC v.1900 64 bit (AMD64)]
Architecture:   64bit
numpy:          C:\PROGRA~3\ANACON~1\lib\site-packages\numpy
numpy_version:  1.12.1
tensorflow:     [NOT FOUND]
@jjallaire

This comment has been minimized.

Copy link
Member

commented Jul 2, 2017

Could you provide the output from install_tensorflow()?

Could you also provide the output of sessionInfo(). Is it possible you are running 32-bit R but 64-bit Anaconda?

@HARIGB

This comment has been minimized.

Copy link
Author

commented Jul 2, 2017

Hi,

> library(tensorflow)
> install_tensorflow()
Using r-tensorflow conda environment for TensorFlow installation
Determining latest release of TensorFlow...done
Installing TensorFlow...
Collecting tensorflow==1.2.1 from https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.2.1-cp36-cp36m-win_amd64.whl
  Using cached https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.2.1-cp36-cp36m-win_amd64.whl
Collecting bleach==1.5.0 (from tensorflow==1.2.1)
  Using cached bleach-1.5.0-py2.py3-none-any.whl
Collecting werkzeug>=0.11.10 (from tensorflow==1.2.1)
  Using cached Werkzeug-0.12.2-py2.py3-none-any.whl
Collecting wheel>=0.26 (from tensorflow==1.2.1)
  Using cached wheel-0.29.0-py2.py3-none-any.whl
Collecting backports.weakref==1.0rc1 (from tensorflow==1.2.1)
  Using cached backports.weakref-1.0rc1-py3-none-any.whl
Collecting six>=1.10.0 (from tensorflow==1.2.1)
  Using cached six-1.10.0-py2.py3-none-any.whl
Collecting markdown>=2.6.8 (from tensorflow==1.2.1)
Collecting html5lib==0.9999999 (from tensorflow==1.2.1)
Collecting numpy>=1.11.0 (from tensorflow==1.2.1)
  Using cached numpy-1.13.0-cp36-none-win_amd64.whl
Collecting protobuf>=3.2.0 (from tensorflow==1.2.1)
Collecting setuptools (from protobuf>=3.2.0->tensorflow==1.2.1)
  Using cached setuptools-36.0.1-py2.py3-none-any.whl
Installing collected packages: six, html5lib, bleach, werkzeug, wheel, backports.weakref, markdown, numpy, setuptools, protobuf, tensorflow
Successfully installed backports.weakref-1.0rc1 bleach-1.5.0 html5lib-0.9999999 markdown-2.6.8 numpy-1.13.0 protobuf-3.3.0 setuptools-36.0.1 six-1.10.0 tensorflow-1.2.1 werkzeug-0.12.2 wheel-0.29.0
Fetching package metadata ...........
Solving package specifications: .

# All requested packages already installed.
# packages in environment at C:\Users\HARI G B\AppData\Local\conda\conda\envs\r-tensorflow:
#
h5py                      2.7.0               np113py36_0  
pillow                    4.1.1                    py36_0  
pyyaml                    3.12                     py36_0  
requests                  2.14.2                   py36_0  
scipy                     0.19.1              np113py36_0  

Installation of TensorFlow complete.

&

sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_India.1252  LC_CTYPE=English_India.1252    LC_MONETARY=English_India.1252
[4] LC_NUMERIC=C                   LC_TIME=English_India.1252    

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

other attached packages:
[1] tensorflow_0.9.0.9001

loaded via a namespace (and not attached):
 [1] httr_1.2.1            compiler_3.4.1        R6_2.2.2              tools_3.4.1          
 [5] withr_1.0.2           curl_2.7              Rcpp_0.12.11          reticulate_0.9.0.9000
 [9] memoise_1.1.0         git2r_0.18.0          jsonlite_1.5          digest_0.6.12        
[13] devtools_1.13.2      

after this I was trying the following

> library(tensorflow)
> sess = tf$Session()
Error: Installation of TensorFlow not found.

Python environments searched for 'tensorflow' package:
 C:\Users\HARI G B\AppData\Local\Programs\Python\Python36-32\python.exe
 C:\ProgramData\Anaconda3\python.exe

You can install TensorFlow using the install_tensorflow() function.
@jjallaire

This comment has been minimized.

Copy link
Member

commented Jul 2, 2017

So for some reason it can't find the conda environment that was created. What is the output of:

reticulate::conda_list()
@HARIGB

This comment has been minimized.

Copy link
Author

commented Jul 2, 2017

> reticulate::conda_list()
          name                                                                            python
1 r-tensorflow C:\\Users\\HARI G B\\AppData\\Local\\conda\\conda\\envs\\r-tensorflow\\python.exe
2   tensorflow   C:\\Users\\HARI G B\\AppData\\Local\\conda\\conda\\envs\\tensorflow\\python.exe
3         root                                            C:\\ProgramData\\Anaconda3\\python.exe
@jjallaire

This comment has been minimized.

Copy link
Member

commented Jul 2, 2017

What about reticulate::py_config() ?

@jjallaire

This comment has been minimized.

Copy link
Member

commented Jul 2, 2017

One guess is that the problem is the spaces in your username path. We should be resilient to that but it's possible we are not. What happens if you try this:

library(tensorflow)
use_condaenv("r-tensorflow")
sess <- tf$Session()
@jjallaire

This comment has been minimized.

Copy link
Member

commented Jul 2, 2017

Then after that what is the output of reticulate::py_config()

@HARIGB

This comment has been minimized.

Copy link
Author

commented Jul 2, 2017

> reticulate::py_config()
python:         C:\PROGRA~3\ANACON~1\python.exe
libpython:      C:/PROGRA~3/ANACON~1/python36.dll
pythonhome:     C:\PROGRA~3\ANACON~1
version:        3.6.1 |Anaconda 4.4.0 (64-bit)| (default, May 11 2017, 13:25:24) [MSC v.1900 64 bit (AMD64)]
Architecture:   64bit
numpy:          C:\PROGRA~3\ANACON~1\lib\site-packages\numpy
numpy_version:  1.12.1
tensorflow:     [NOT FOUND]

python versions found: 
 C:\Users\HARIGB~1\AppData\Local\Programs\Python\PYTHON~1\\python.exe
 C:\PROGRA~3\ANACON~1\python.exe

> library(tensorflow)
> use_condaenv("r-tensorflow")
> sess <- tf$Session()
Error: Python module tensorflow was not found.

Detected Python configuration:

python:         C:\PROGRA~3\ANACON~1\python.exe
libpython:      C:/PROGRA~3/ANACON~1/python36.dll
pythonhome:     C:\PROGRA~3\ANACON~1
version:        3.6.1 |Anaconda 4.4.0 (64-bit)| (default, May 11 2017, 13:25:24) [MSC v.1900 64 bit (AMD64)]
Architecture:   64bit
numpy:          C:\PROGRA~3\ANACON~1\lib\site-packages\numpy
numpy_version:  1.12.1
tensorflow:     [NOT FOUND]

python versions found: 
 C:\Users\HARIGB~1\AppData\Local\Programs\Python\PYTHON~1\\python.exe
 C:\PROGRA~3\ANACON~1\python.exe
> reticulate::py_config()
python:         C:\PROGRA~3\ANACON~1\python.exe
libpython:      C:/PROGRA~3/ANACON~1/python36.dll
pythonhome:     C:\PROGRA~3\ANACON~1
version:        3.6.1 |Anaconda 4.4.0 (64-bit)| (default, May 11 2017, 13:25:24) [MSC v.1900 64 bit (AMD64)]
Architecture:   64bit
numpy:          C:\PROGRA~3\ANACON~1\lib\site-packages\numpy
numpy_version:  1.12.1
tensorflow:     [NOT FOUND]

python versions found: 
 C:\Users\HARIGB~1\AppData\Local\Programs\Python\PYTHON~1\\python.exe
 C:\PROGRA~3\ANACON~1\python.exe
@jjallaire

This comment has been minimized.

Copy link
Member

commented Jul 2, 2017

I just checked in a fix which should handle spaces within the paths of conda environments. Could you restart R then re-install reticulate with:

devtools::install_github("rstudio/reticulate")

Then try again?

@HARIGB

This comment has been minimized.

Copy link
Author

commented Jul 2, 2017

Finally it Worked!! Great, Thanks a lot for your support.

* DONE (reticulate)
> library(tensorflow)
> use_condaenv("r-tensorflow")
> sess <- tf$Session()
> hello <- tf$constant('Hello, TensorFlow!')
> sess$run(hello)
b'Hello, TensorFlow!'

@HARIGB HARIGB closed this Jul 2, 2017

@jjallaire

This comment has been minimized.

Copy link
Member

commented Jul 2, 2017

Great! IT should work without the use_condaenv btw.

Thanks for reporting and sticking with it until we got to the root problem!

@HARIGB

This comment has been minimized.

Copy link
Author

commented Jul 2, 2017

Its all because I was inspired by your dedication towards the immediate responses. Great Sir Ji Keep it up.

@jjallaire

This comment has been minimized.

Copy link
Member

commented Jul 2, 2017

@tle4336

This comment has been minimized.

Copy link

commented Apr 16, 2019

@jjallaire can you please also help me out Sir?? I got the same problem. I tried everything above, but I still end up with

sess <- tf$Session()
Error: Installation of TensorFlow not found.

Python environments searched for 'tensorflow' package:
/Users/[name]/Downloads/anaconda2/bin/python2.7
/usr/bin/python
/Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5
/Users/[name]/venv/bin/python2.7

You can install TensorFlow using the install_tensorflow() function.

@zefreh

This comment has been minimized.

Copy link

commented Jul 17, 2019

I have the same problem.

@Glender

This comment has been minimized.

Copy link

commented Aug 8, 2019

I still encounter the same problem as HARIGB, but the solutions offered by jjallaire did not fix it for me. Help is deeply appreciated...

@jdblischak

This comment has been minimized.

Copy link

commented Aug 14, 2019

For those still getting the error Installation of TensorFlow not found., one thing to try is uninstalling Anaconda, reinstalling Anaconda, and then running conda update --all to make sure everything is the latest version. This recently fixed the error for a user on RStudio Community.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.