TensorFlow installation error


I am trying to get up and running with greta but am encountering errors in the installation process, specifically with TensorFlow and TensorFlow Probability. On a desktop running MacOS 10.15.3 (Catalina) and R version 3.6.2, I first installed python with Anaconda and then started following the installation instructions here. I successfully installed greta from CRAN but ran into a problem at

install_tensorflow(method = "conda")

which yielded Error: could not find a Python environment for /usr/bin/python. I then installed TensorFlow from the command line (pip install tensorflow) and tried the next step in the greta installation,

reticulate::conda_install("r-tensorflow", "tensorflow-probability", pip = TRUE)

which yielded the same error as above. I evaded this error by adding envname = "~/opt/anaconda3/envs/r-tensorflow" to conda_install. However, when I tried to run the example code

(a <- variable(dim = c(3, 3)))

I got the error

This version of greta requires TensorFlow v1.14.0 and TensorFlow Probability v0.7.0, but TensorFlow isn't installed and TensorFlow Probability isn't installed. To install the correct versions do:

    method = "conda",
    version = "1.14.0",
    extra_packages = "tensorflow-probability"

which, when I try it, results in the same old error about not being able to find the Python environment.

I’m a bit at a loss for ideas and so I’m hoping there is a way out of this impasse. Any help would be appreciated. Thanks!


I recommend these instructions:

I teach using greta and have found the above to almost always be successful. Let me know if it helps. good luck!