Installation problems with tensorflow in macOS Catalina

Since updating to Catalina, I haven't been able to use tensorflow or keras at all. I've reinstalled both tensorflow and keras R packages, and also the underlying python modules, using the install_tensorflow() and install_keras() functions. Here's what I get:

> library(keras)
> x <- layer_input(shape = 10)
Error in py_get_attr_impl(x, name, silent) : 
  AttributeError: module 'tensorflow' has no attribute 'VERSION'

I don't understand the error message - surely if the tensorflow module is installed it should have a version?

This is what my python configurations look like by the way:

> reticulate::py_config()
python:         /Users/luis/.virtualenvs/r-reticulate/bin/python
libpython:      /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/config-3.7m-darwin/libpython3.7.dylib
pythonhome:     /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7:/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7
version:        3.7.3 (default, Oct  2 2019, 18:49:20)  [Clang 11.0.0 (clang-1100.0.33.11)]
numpy:          /Users/luis/.virtualenvs/r-reticulate/lib/python3.7/site-packages/numpy
numpy_version:  1.17.3
tensorflow:     /Users/luis/.virtualenvs/r-reticulate/lib/python3.7/site-packages/tensorflow

python versions found: 
 /Users/luis/.virtualenvs/r-reticulate/bin/python
 /usr/bin/python
 /usr/bin/python3
 /usr/local/bin/python3

Any help would be greatly appreciated - the R bindings to python and tensorflow are phenomenal and I would really like to keep using them!

1 Like

I'm experiencing the same problem, which I explained on:

https://stackoverflow.com/questions/58412444/error-message-attributeerror-module-tensorflow-has-no-attribute-version/58461306#58461306

I'm having the same difficulty too :frowning:

The tightened security in Catalina causes a variety of issues with all sorts of open source software. My experience is given that so many things (which I use on a regular basis - YMMV) break in so many ways the advice would be not to install the new OS in the next few months and/or check every tool you use for compatibility with Catalina.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.