树莓派python中安装numpy,pandas,torch,torchvision失败,ERROR: Could not find a version that satisfies the req

树莓派python中安装numpy,pandas,torch,torchvision问题

安装失败现象

python通过pip安装torch错误ERROR: Could not find a version that satisfies the requirement torch
其他库也类似上述报错

pip命令安装上述库失败原因

树莓派基于arm6架构,因此直接用pip命令安装各种库的时候,会默认安装linux_x86或aarch64版本的库,导致出现版本无法匹配问题。

解决

从连接中下载对应armv7l版本的库,然后放到树莓派中安装,进入whl所在文件夹,执行下边命令。至于是cp37,cp38还是cp39,可以都下载试一试哪一个版本可用。本人树莓派4b,python3.7.3使用的numpy,pandas,torch,torchvision都是cp37版本,如图所示。(以下给出多个连接防止丢失连接)

pip install numpy-1.21.4-cp37-cp37m-liux_armv7l.whl

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
貌似只有第一和第二个有armv7l的包,剩下两个连接没有。当然你也可以去github找,不过github上的arm7l库都是零零散散的。
官网链接:链接: https://www.piwheels.org/simple/
链接: https://torch.kmtea.eu/whl/stable.html
链接: https://download.pytorch.org/whl/torch_stable.html
链接: https://pypi.tuna.tsinghua.edu.cn/simple/
github连接
链接: https://github.com/nmilosev/pytorch-arm-builds
链接: https://github.com/Kashu7100/pytorch-armv7l

注意

如果先安装pandas,torch,torchvision完成后导入运行的话,一般都会报错numpy版本问题,然后提示你更新numpy,这时候别直接命令行更新哈,就去上边连接下载numpy的armv7l包,然后放到树莓派里手动安装,然后再导入pandas,torch,torchvision的armv7l的包就没事了。
总之就是最好先装numpy的armv7l,再装其他库的armv7l,就不会报错。

  • 2
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
ERROR: Could not find a version that satisfies the requirement numpy (from torchvision) (from versions: none)错误提示表示无法找到满足torchvisionnumpy依赖的版本。根据引用和的内容,这个问题可能是由于numpy版本不匹配导致的。为了解决这个问题,可以尝试以下方法: 1. 检查你的Python版本:首先确保你使用的是与torchvision兼容的Python版本。根据引用的信息,Pillow库支持的最高Python版本是Python 2.7,而更高版本的Python可以使用Pillow库作为PIL库的替代。因此,你可以尝试使用Pillow库来替代PIL库。 2. 更新numpy库:如果你已经确认你的Python版本与torchvision兼容,那么你可以尝试升级numpy库。使用pip命令来更新numpy库的版本,如下所示:pip install --upgrade numpy。这将会更新numpy库到最新版本,解决可能由于旧版本导致的不匹配问题。 3. 检查torchvision的依赖关系:还有可能是其他包的依赖关系导致了numpy版本不匹配的问题。你可以查看torchvision的文档或者github页面,了解它的依赖关系。然后逐个检查这些依赖关系的版本,并确保它们与numpy兼容。 4. 清除缓存并重新安装:有时候,错误可能是由于缓存问题引起的。你可以尝试清除pip的缓存并重新安装numpy,如下所示:pip cache purge,然后再次执行pip install numpy命令来重新安装numpy。 总之,根据错误提示,你可以尝试更新numpy库或检查torchvision的依赖关系,以解决ERROR: Could not find a version that satisfies the requirement numpy (from torchvision) (from versions: none)错误。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* *3* [ERROR: Could not find a version that satisfies the requirement PIL (from versions: none)解决方案](https://blog.csdn.net/weixin_43178406/article/details/130536747)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值