树莓派4B安装 tensorflow 2.3.0版本

新人笔记 2022/4/2

树莓派python3.7.3安装opencv、TensorFlow2.3_G_ZqyLkl的博客-CSDN博客

自己的操作步骤及遇到的情况

1、在联网的树莓派界面,打开浏览器输入下面,下载tensorflow2.3.0

https://github.com/lhelontra/tensorflow-on-arm/releases/download/v2.3.0/tensorflow-2.3.0-cp37-none-linux_armv7l.whl

2、在存放whl的文件夹下按F4(一般是放在Downloads下),然后在打开的命令终端输入:pip install tensorflow-2.3.0-cp37-none-linux_armv7l.whl

没在所下载文件位置打开文件

Defaulting to user installation because normal site-packages is not writeable
WARNING: Requirement 'tensorflow-2.3.0-cp37-none-linux_armv7l.whl' looks like a filename, but the file does not exist   这个是没有在在存放whl的文件夹下按F4(一般是放在Downloads下)

若正常

输入python

import tensorflow as tf 查看,若没报错则安装成功

3、在终端遇到了 请更新python的错误,我直接卸载了树莓派4B自带的python2.7版本

提示:pi@raspberrypi:~ $ pip install tensorflow-2.3.0-cp37-none-linux_armv7l.whl
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.   好像是因为python2的影响

转: 树莓派删除Python2.7 默认Python3.7 - 简书

4、要求更新pip的错误,ModuleNotFoundError: No module named ‘pip._internal.cli.main‘报错,解决方法

Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
ERROR: tensorflow-2.3.0-cp37-none-linux_armv7l.whl is not a supported wheel on this platform.
WARNING: You are using pip version 20.2.4; however, version 20.3.4 is available.
You should consider upgrading via the '/usr/bin/python -m pip install --upgrade pip' command.这个要求更新pip

ModuleNotFoundError: No module named ‘pip._internal.cli.main‘报错,解决方法_tacity的博客-CSDN博客

5、安装失败 ,因为下载速度较慢,出现哈希值不匹配

ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.

2022/4/4 解决哈希值不匹配,将树莓派中的源,更换为国内镜像

树莓派更改软件源 - Zbuter - 博客园

一键换取清华源

sudo sed -i 's#://mirrordirector.raspbian.org#s://mirrors.tuna.tsinghua.edu.cn/raspbian#g' /etc/apt/sources.list sudo sed -i 's#://archive.raspberrypi.org/debian#s://mirrors.tuna.tsinghua.edu.cn/raspberrypi#g' /etc/apt/sources.list.d/raspi.list

树莓派4B安装 tensorflow 2.3.0版本_第1张图片

 

你可能感兴趣的:(python)