rstudio / tensorflow.rstudio.com

https://tensorflow.rstudio.com
9 stars 12 forks source link

Error creating conda environment 'r-reticulate' [exit code 1] #37

Open kurtgodden opened 1 year ago

kurtgodden commented 1 year ago

I followed your installation instructions at: https://tensorflow.rstudio.com/install/ and received this error upon running: tf$constant("Hello Tensorflow!") The error also tells me "ERROR: The install method you used for conda--probably either pip install conda or easy_install conda--is not compatible with using conda as an application."

I have Anaconda installed with Python 3.9 on macOS 13.0.1 on a MacBook Pro with Intel i9. I've been unable to discover fixes in the usual places, and am wondering if this was due to macOS, as I had tensorflow and keras working just fine in RStudio pre-Ventura. Thoughts?

t-kalinowski commented 1 year ago

It's possible that you have two environments named "r-reticulate", a conda environment and a virtual environment.

You can try to create a dedicated virtual environment for the R tensorflow package like this:

library(reticulate)
path_to_python <- install_python()
virtualenv_create("r-tensorflow", python = path_to_python)

library(tensorflow)
install_tensorflow(envname = "r-tensorflow")
use_virtualenv("r-tensorflow")
tf$constant("Hello Tensorflow!")