rstudio / tensorflow.rstudio.com

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

Installing Tensorflow in R, MacOS Ventura 13.3 on Apple Mi Max #54

Open fabarrios opened 1 year ago

fabarrios commented 1 year ago

Following the instructions at https://tensorflow.rstudio.com/install/

In RStudio:

After making r-reticulate environment , and install tensorflow get:

install_tensorflow(envname = "r-reticulate") Installing: tensorflow-deps

UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versions

Error: one or more Python packages failed to install [error code 1]

Then if I try to install keras I get the same:

Installing: tensorflow-deps

UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versions

Error: one or more Python packages failed to install [error code 1]

t-kalinowski commented 1 year ago

How did you make the r-reticulate environment? It looks like there was something previously installed into the 'r-reticulate' conda env, and then the conda dependency resolver is failing because the new request conflicts with the previously installed request. (This is unfortunately, a common situation with conda).

The quickest path to success is to create a fresh, dedicated, conda environment.

reticulate::conda_remove("r-reticulate")
tensorflow::install_tensorflow(condaenv = "r-reticulate")

It looks like you've installed miniconda manually and didn't use reticulate::install_miniconda(). If you're more comfortable managing conda from the terminal, here is an example showing how:

## If you installed miniconda using reticulate::install_miniconda()
# source /Users/$USER/Library/r-miniconda-arm64/bin/activate

conda create --yes --name r-tensorflow
conda activate r-tensorflow
conda install -c apple tensorflow-deps
python -m pip install tensorflow-macos
python -m pip install tensorflow-metal
fabarrios commented 1 year ago

Thank you very much

To a new session of RStudio I did:

reticulate::conda_remove("r-reticulate")

Since you are right, I did install miniconda manually from: Miniconda3-latest-MacOSX-arm64.sh of another project, at RStudio I reinstalled miniconda (hoping for the best):

reticulate::install_miniconda()

I noticed that python this time is 3.8, and not 3.11 (from my homebrew), and then did: Library (tensor flow) tensorFlow::install_tensorflow(condaenv = "r-reticulate")

This time the installation finished. Now I can continue working with your book. Thank you very much. Fernando

Prof. Fernando A. Barrios, PhD Chair of the Behavioral and Cognitive Neurobiology Department Neurobiology Institute National Autonomous University of Mexico (UNAM) Blvd. Juriquilla # 3001 Juriquilla, Queretaro, QRO 76230, Mexico TEL: 52(55) 5623-4053 @. @.

On 6 Apr 2023, at 7:15, Tomasz Kalinowski @.***> wrote:

How did you make the r-reticulate environment? It looks like there was something previously installed into the 'r-reticulate' conda env, and then the conda dependency resolver is failing because the new request conflicts with the previously installed request. (This is unfortunately, a common situation with conda).

The quickest path to success is to create a fresh, dedicated, conda environment.

reticulate::conda_remove("r-reticulate") tensorFlow::install_tensorflow(condaenv = "r-reticulate") It looks like you've installed miniconda manually and didn't use reticulate::install_miniconda(). If you're more comfortable managing conda from the terminal, here is an example showing how:

If you installed miniconda using reticulate::install_miniconda()

source /Users/$USER/Library/r-miniconda-arm64/bin/activate

conda create --yes --name r-tensorflow conda activate r-tensorflow conda install -c apple tensorflow-deps python -m pip install tensorflow-macos python -m pip install tensorflow-metal — Reply to this email directly, view it on GitHub https://github.com/rstudio/tensorflow.rstudio.com/issues/54#issuecomment-1499048473, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJ4JQPWZSF5KCASDZNEN6TW726YNANCNFSM6AAAAAAWUNUVIU. You are receiving this because you authored the thread.