python r语言 深度学习 在R上安装tensorflow.keras的坎坷过程 - 去这个网址下载安装包到电脑上https://github

📅 2026-11-30 👤 拼多多助力营销技巧 📂 拼多多助力网 👁️ 520 次阅读

Error: Python module tensorflow.keras was not found.

错误尝试1. 先尝试install Tensorflow:

install.packages("tensorflow")

library(tensorflow)

Error: Valid installation of TensorFlow not found. 。。。 ModuleNotFoundError: No module named 'tensorflow' You can install TensorFlow using the install_tensorflow() function.

错误尝试2. 另一种代码install TensorFlow:

install_tensorflow()

Error: Tensorflow installation failed (no conda binary found)

Install Miniconda by running `reticulate::install_miniconda()`before installing Tensorflow.

错误尝试3. 尝试安装miniconda:

reticulate::install_miniconda()

Error in download.file(url, destfile = installer, mode = "wb") : cannot open URL 'https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh'

错误尝试4. 挂vpn重新上一步

也不行

错误尝试5. 去这个网址下载安装包到电脑上https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh

install.packages("~/Downloads/Miniforge3-MacOSX-arm64.sh")

Warning in install.packages : package ‘~/Downloads/Miniforge3-MacOSX-arm64.sh’ is not available for this version of R A version of this package for your version of R might be available elsewhere, see the ideas at https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages

总之,miniconda装不上。

正确步骤1. 找到keras的介绍文档,发现了这个网址,里面讲了怎么安装keras。TensorFlow for R - Quick start

library(tensorflow)

install_tensorflow(envname = "r-reticulate")

就可以了。但是同样的步骤在新买的电脑出现error,说明之前的电脑已经安装了一些必要的包,新电脑上没有。

Error: Tensorflow installation failed (no conda binary found) Install Miniconda by running `reticulate::install_miniconda()`before installing Tensorflow.

正确步骤2. 先去这个网页安装python Download Python | Python.org

错误尝试6. 装好python重试还是不行,又出现了第三步的error 拼多多帮助力入口

library(tensorflow)

install_tensorflow(envname = "r-reticulate")

Error: Tensorflow installation failed (no conda binary found) Install Miniconda by running `reticulate::install_miniconda()`before installing Tensorflow.

why??

错误尝试7. 去网上下载miniconda然后安装到电脑上Miniconda — conda documentation

library(tensorflow)

install_tensorflow(envname = "r-reticulate")

Installing: tensorflow-deps + '/Users/cicelyguo/miniconda3/bin/conda' 'install' '--yes' '--name' 'r-reticulate' '-c' 'apple' '-c' 'conda-forge' 'tensorflow-deps' Collecting package metadata (current_repodata.json): ...working... done Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve. Solving environment: ...working... failed with repodata from current_repodata.json, will retry with next repodata source. Collecting package metadata (repodata.json): ...working... done Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve. Solving environment: ...working... Found conflicts! Looking for incompatible packages. This can take several minutes. Press CTRL-C to abort. failed

错误尝试8. 手动安装tensorflow到电脑上

https://www.tensorflow.org/install/

pip install tensorflow

ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)

ERROR: No matching distribution found for tensorflow

放弃这个电脑

推荐文章

标签: 拼多多助力网站平台 赚钱项目 拼多多助力网 首码项目 手赚APP
拼多多助力营销技巧