解决caffe中的python环境安装的问题(补充)

上一篇(解决caffe中的python环境安装的问题_qiuchangyong的博客-CSDN博客)说到了安装过程中遇到的常见问题,其实还有一个忘了补充,就是在执行命令"sudo python -m pip install -r requirements.txt"后,出现protobuf安装失败的情况:

$ sudo python -m pip install -r requirements.txt 
Requirement already satisfied: Cython>=0.19.2 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 1))
Requirement already satisfied: numpy>=1.7.1 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 2))
Requirement already satisfied: scipy>=0.13.2 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 3))
Requirement already satisfied: scikit-image>=0.9.3 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 4))
Requirement already satisfied: matplotlib>=1.3.1 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 5))
Requirement already satisfied: ipython>=3.0.0 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 6))
Requirement already satisfied: h5py>=2.2.0 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 7))
Requirement already satisfied: leveldb>=0.191 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 8))
Requirement already satisfied: networkx>=1.8.1 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 9))
Requirement already satisfied: nose>=1.3.0 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 10))
Requirement already satisfied: pandas>=0.12.0 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 11))
Requirement already satisfied: python-dateutil<2,>=1.4 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 12))
Collecting protobuf>=2.5.0 (from -r requirements.txt (line 13))Using cached https://files.pythonhosted.org/packages/6c/be/4e32d02bf08b8f76bf6e59f2a531690c1e4264530404501f3489ca975d9a/protobuf-4.21.0-py2.py3-none-any.whl
protobuf requires Python '>=3.7' but the running Python is 2.7.18
You are using pip version 9.0.1, however version 23.2.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

这是由于下载的protobuf版本过高而不能适配Python2.7导致的,解决方法就是限制protobuf版本,可以将requirements.txt中的"protobuf>=2.5.0"一行改为"protobuf>=2.5.0,<3",再安装。

结果又遇到一个错误:

$ sudo python -m pip install -r requirements.txt 
Requirement already satisfied: Cython>=0.19.2 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 1))
Requirement already satisfied: numpy>=1.7.1 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 2))
Requirement already satisfied: scipy>=0.13.2 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 3))
Requirement already satisfied: scikit-image>=0.9.3 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 4))
Requirement already satisfied: matplotlib>=1.3.1 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 5))
Requirement already satisfied: ipython>=3.0.0 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 6))
Requirement already satisfied: h5py>=2.2.0 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 7))
Requirement already satisfied: leveldb>=0.191 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 8))
Requirement already satisfied: networkx>=1.8.1 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 9))
Requirement already satisfied: nose>=1.3.0 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 10))
Requirement already satisfied: pandas>=0.12.0 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 11))
Requirement already satisfied: python-dateutil<2,>=1.4 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 12))
Collecting protobuf<3,>=2.5.0 (from -r requirements.txt (line 13))Downloading https://files.pythonhosted.org/packages/2c/05/10c2611da9149677abfae24e208761794561e406c37d78c36bd8dda8ea80/protobuf-2.6.1.tar.gz (188kB)100% |████████████████████████████████| 194kB 306kB/s Complete output from command python setup.py egg_info:Couldn't find index page for 'google-apputils' (maybe misspelled?)No local packages or working download links found for google-apputilsTraceback (most recent call last):File "<string>", line 1, in <module>File "/tmp/pip-build-vFweOs/protobuf/setup.py", line 200, in <module>"Protocol Buffers are Google's data interchange format.",File "/usr/lib/python2.7/distutils/core.py", line 111, in setup_setup_distribution = dist = klass(attrs)File "build/bdist.linux-x86_64/egg/setuptools/dist.py", line 335, in __init__File "build/bdist.linux-x86_64/egg/setuptools/dist.py", line 456, in fetch_build_eggsFile "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 863, in resolveFile "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 1141, in best_matchFile "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 1153, in obtainFile "build/bdist.linux-x86_64/egg/setuptools/dist.py", line 522, in fetch_build_eggFile "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 666, in easy_installdistutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('google-apputils')----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-vFweOs/protobuf/
You are using pip version 9.0.1, however version 23.2.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

根据提示,知道是google-apputils没有安装,于是安装"sudo python -m pip install google-apputils",安装完之后,再执行命令"sudo python -m pip install -r requirements.txt"

$ sudo python -m pip install -r requirements.txt
[sudo] lixiang 的密码: 
Requirement already satisfied: Cython>=0.19.2 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 1))
Requirement already satisfied: numpy>=1.7.1 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 2))
Requirement already satisfied: scipy>=0.13.2 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 3))
Requirement already satisfied: scikit-image>=0.9.3 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 4))
Requirement already satisfied: matplotlib>=1.3.1 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 5))
Requirement already satisfied: ipython>=3.0.0 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 6))
Requirement already satisfied: h5py>=2.2.0 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 7))
Requirement already satisfied: leveldb>=0.191 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 8))
Requirement already satisfied: networkx>=1.8.1 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 9))
Requirement already satisfied: nose>=1.3.0 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 10))
Requirement already satisfied: pandas>=0.12.0 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 11))
Requirement already satisfied: python-dateutil<2,>=1.4 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 12))
Collecting protobuf<3,>=2.5.0 (from -r requirements.txt (line 13))Downloading https://files.pythonhosted.org/packages/2c/05/10c2611da9149677abfae24e208761794561e406c37d78c36bd8dda8ea80/protobuf-2.6.1.tar.gz (188kB)100% |████████████████████████████████| 194kB 305kB/s 
Requirement already satisfied: python-gflags>=2.0 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 14))
Requirement already satisfied: pyyaml>=3.10 in /usr/lib/python2.7/dist-packages (from -r requirements.txt (line 15))
Requirement already satisfied: Pillow>=2.3.0 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 16))
Requirement already satisfied: six>=1.1.0 in /usr/lib/python2.7/dist-packages (from -r requirements.txt (line 17))
Requirement already satisfied: cloudpickle>=0.2.1 in /usr/local/lib/python2.7/dist-packages (from scikit-image>=0.9.3->-r requirements.txt (line 4))
Requirement already satisfied: PyWavelets>=0.4.0 in /usr/local/lib/python2.7/dist-packages (from scikit-image>=0.9.3->-r requirements.txt (line 4))
Requirement already satisfied: pytz in /usr/local/lib/python2.7/dist-packages (from matplotlib>=1.3.1->-r requirements.txt (line 5))
Requirement already satisfied: backports.functools-lru-cache in /usr/local/lib/python2.7/dist-packages (from matplotlib>=1.3.1->-r requirements.txt (line 5))
Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python2.7/dist-packages (from matplotlib>=1.3.1->-r requirements.txt (line 5))
Requirement already satisfied: subprocess32 in /usr/local/lib/python2.7/dist-packages (from matplotlib>=1.3.1->-r requirements.txt (line 5))
Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python2.7/dist-packages (from matplotlib>=1.3.1->-r requirements.txt (line 5))
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/local/lib/python2.7/dist-packages (from matplotlib>=1.3.1->-r requirements.txt (line 5))
Requirement already satisfied: setuptools>=18.5 in /usr/local/lib/python2.7/dist-packages/setuptools-36.6.0-py2.7.egg (from ipython>=3.0.0->-r requirements.txt (line 6))
Requirement already satisfied: backports.shutil-get-terminal-size; python_version == "2.7" in /usr/local/lib/python2.7/dist-packages (from ipython>=3.0.0->-r requirements.txt (line 6))
Requirement already satisfied: simplegeneric>0.8 in /usr/local/lib/python2.7/dist-packages (from ipython>=3.0.0->-r requirements.txt (line 6))
Requirement already satisfied: traitlets>=4.2 in /usr/local/lib/python2.7/dist-packages (from ipython>=3.0.0->-r requirements.txt (line 6))
Requirement already satisfied: pygments<2.6 in /usr/lib/python2.7/dist-packages (from ipython>=3.0.0->-r requirements.txt (line 6))
Requirement already satisfied: prompt-toolkit<2.0.0,>=1.0.4 in /usr/local/lib/python2.7/dist-packages (from ipython>=3.0.0->-r requirements.txt (line 6))
Requirement already satisfied: pathlib2; python_version == "2.7" or python_version == "3.3" in /usr/local/lib/python2.7/dist-packages (from ipython>=3.0.0->-r requirements.txt (line 6))
Requirement already satisfied: decorator in /usr/local/lib/python2.7/dist-packages (from ipython>=3.0.0->-r requirements.txt (line 6))
Requirement already satisfied: pickleshare in /usr/local/lib/python2.7/dist-packages (from ipython>=3.0.0->-r requirements.txt (line 6))
Requirement already satisfied: pexpect; sys_platform != "win32" in /usr/local/lib/python2.7/dist-packages (from ipython>=3.0.0->-r requirements.txt (line 6))
Requirement already satisfied: enum34; python_version == "2.7" in /usr/local/lib/python2.7/dist-packages (from traitlets>=4.2->ipython>=3.0.0->-r requirements.txt (line 6))
Requirement already satisfied: ipython-genutils in /usr/local/lib/python2.7/dist-packages (from traitlets>=4.2->ipython>=3.0.0->-r requirements.txt (line 6))
Requirement already satisfied: wcwidth in /usr/local/lib/python2.7/dist-packages (from prompt-toolkit<2.0.0,>=1.0.4->ipython>=3.0.0->-r requirements.txt (line 6))
Requirement already satisfied: typing; python_version < "3.5" in /usr/local/lib/python2.7/dist-packages (from pathlib2; python_version == "2.7" or python_version == "3.3"->ipython>=3.0.0->-r requirements.txt (line 6))
Requirement already satisfied: scandir; python_version < "3.5" in /usr/local/lib/python2.7/dist-packages (from pathlib2; python_version == "2.7" or python_version == "3.3"->ipython>=3.0.0->-r requirements.txt (line 6))
Requirement already satisfied: ptyprocess>=0.5 in /usr/local/lib/python2.7/dist-packages (from pexpect; sys_platform != "win32"->ipython>=3.0.0->-r requirements.txt (line 6))
Building wheels for collected packages: protobufRunning setup.py bdist_wheel for protobuf ... doneStored in directory: /root/.cache/pip/wheels/b6/ed/a8/e3c2135065922705a433364cfba163707da6d8f8d38e2cc972
Successfully built protobuf
Installing collected packages: protobuf
Successfully installed protobuf-2.6.1
You are using pip version 9.0.1, however version 23.2.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

没有出现错误,大功告成!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/94664.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

全志ARM926 Melis2.0系统的开发指引①

全志ARM926 Melis2.0系统的开发指引① 1. 编写目的2. Melis2.0 系统概述3. Melis2.0 快速开发3.1. Melis2.0 SDK 目录结构3.2. Melis2.0 编译环境3.3. Melis2.0 固件打包3.4. Melis2.0 固件烧录3.5.串口打印信息3.6. Melis2.0 添加和调用一个模块3.6.1. 为什么划分模块&#xf…

Python中Lambda用法

在Python中&#xff0c;lambda函数是一种形式较短的函数&#xff0c;又称为匿名函数。与正常的函数不同&#xff0c;lambda函数没有名称&#xff0c;因此只能在定义时直接传递给其他函数或变量使用&#xff0c;而不能单独调用。 lambda函数的语法非常简单&#xff0c;格式如下…

Python中print()打印如何不换行?

文章目录 Python中print()打印如何不换行python2.xpython3.x print()函数语法objects基本语法sep基本语法end基本语法 Python中print()打印如何不换行 print() 函数用于打印输出&#xff0c;是python中最常见的一个内置函数。 如何在Python中打印两个或多个变量、语句时而不进…

软件或游戏提示msvcp120.dll丢失的5种常用解决方法,msvcp120.dll文件全面解析

在当今数字化的时代&#xff0c;我们的生活已经离不开各种软件和游戏。然而&#xff0c;有时候我们可能会遇到一些技术问题&#xff0c;比如“软件或游戏提示msvcp120.dll丢失”。这个问题对于许多人来说可能很棘手&#xff0c;但是只要掌握了正确的解决方法&#xff0c;就能轻…

【现代机器人学】学习笔记十四:中文版印刷/翻译勘误

首先声明&#xff0c;这个印刷/勘误并非经过官方的认可&#xff0c;只是我个人的粗浅的理解。如果内容有误&#xff0c;恳请大家谅解指正。 其实有的并不算错&#xff0c;只是我个人认为不太准确&#xff0c;在我学习过程中产生了一些小疑惑和误解。 都是一些小毛病&#xff…

OpenCV 14(角点特征Harris和Shi-Tomasi)

一、角点 角点是图像很重要的特征,对图像图形的理解和分析有很重要的作用。角点在三维场景重建运动估计&#xff0c;目标跟踪、目标识别、图像配准与匹配等计算机视觉领域起着非常重要的作用。在现实世界中&#xff0c;角点对应于物体的拐角&#xff0c;道路的十字路口、丁字路…

Redisson—分布式对象

每个Redisson对象实例都会有一个与之对应的Redis数据实例&#xff0c;可以通过调用getName方法来取得Redis数据实例的名称&#xff08;key&#xff09;。 RMap map redisson.getMap("mymap"); map.getName(); // mymap 所有与Redis key相关的操作都归纳在RKeys这…

华为云云耀云服务器L实例评测|Ubuntu云锁防火墙安装搭建使用

华为云云耀云服务器L实例评测&#xff5c;Ubuntu安装云锁防火墙对抗服务器入侵和网络攻击 1.前言概述 华为云耀云服务器L实例是新一代开箱即用、面向中小企业和开发者打造的全新轻量应用云服务器。多种产品规格&#xff0c;满足您对成本、性能及技术创新的诉求。云耀云服务器L…

关于字符拼接

当然&#xff0c;以下是加入了幽默注释的代码和对应的逻辑树&#xff1a; # 提示用户输入input和txt内容&#xff0c;期待用户真有输入 input_text input("请输入input文本&#xff1a;") # 好了&#xff0c;快点输入吧 txt_text input("请输入txt文本&#…

分类预测 | MATLAB实现WOA-FS-SVM鲸鱼算法同步优化特征选择结合支持向量机分类预测

分类预测 | MATLAB实现WOA-FS-SVM鲸鱼算法同步优化特征选择结合支持向量机分类预测 目录 分类预测 | MATLAB实现WOA-FS-SVM鲸鱼算法同步优化特征选择结合支持向量机分类预测效果一览基本介绍程序设计参考资料 效果一览 基本介绍 MATLAB实现WOA-FS-SVM鲸鱼算法同步优化特征选择结…

微信小程序button按钮去除边框去除背景色

button边框 去除button边框 在button上添加plain“true”在css中添加button.avatar-wrapper {background: none}用于去除button背景色在css中添加button.avatar-wrapper[plain]{ border:0 }用于去除button边框

机器学习——KNN算法流程详解(以iris为例)

、 目 录 前情说明 问题陈述 数据说明 KNN算法流程概述 代码实现 运行结果 基于可视化的改进 可视化代码 全部数据可视化总览 分类投票结果 改进后最终代码 前情说明 本书基于《特征工程入门与入门与实践》庄家盛 译版P53页K最近邻&#xff08;KNN&#xff09;算…

《C和指针》笔记33:指针数组

除了创建整型数组一样&#xff0c;也可以声明指针数组。 int *api[10];为了弄清这个复杂的声明&#xff0c;我们假定它是一个表达式&#xff0c;并对它进行求值。下标引用的优先级高于间接访问&#xff0c;所以在这个表达式中&#xff0c;首先执行下标引用。因此&#xff0c;a…

兼顾友好与安全,隐私协议 Unijoin 助推新一轮 Web3 浪潮

区块链本身不仅崇尚去中心化&#xff0c;同时也崇尚公开透明&#xff0c;虽然这正在让 DAO 治理等变得更加公平&#xff0c;但它同时也是一把双刃剑&#xff0c;个人交易者尤其是一些巨鲸交易者的所以链上交易都被公之于众&#xff0c;这似乎并不是他们想要的结果。 所以从加密…

【APUE】文件系统 — 类 du 命令功能实现

一、du命令解析 Summarize disk usage of the set of FILEs, recursively for directories. du 命令用于输出文件所占用的磁盘空间 默认情况下&#xff0c;它会输出当前目录下&#xff08;包括该目录的所有子目录下&#xff09;的所有文件的大小总和&#xff0c;以 1024B 为单…

MySql运维篇---008:日志:错误日志、二进制日志、查询日志、慢查询日志,主从复制:概述 虚拟机更改ip注意事项、原理、搭建步骤

1. 日志 1.1 错误日志 错误日志是 MySQL 中最重要的日志之一&#xff0c;它记录了当 mysqld 启动和停止时&#xff0c;以及服务器在运行过程中发生任何严重错误时的相关信息。当数据库出现任何故障导致无法正常使用时&#xff0c;建议首先查看此日志。 该日志是默认开启的&a…

Scala第十七章节

Scala第十七章节 scala总目录 文档资料下载 章节目标 了解集合的相关概念掌握Traversable集合的用法掌握随机学生序列案例 1. 集合 1.1 概述 但凡了解过编程的人都知道程序 算法 数据结构这句话, 它是由著名的瑞士计算机科学家尼古拉斯沃斯提出来的, 而他也是1984年图灵…

Java数据结构————优先级队列(堆)

一 、 优先级队列 有些情况下&#xff0c;操作的数据可能带有优先级&#xff0c; 一般出队列时&#xff0c;可能需要优先级高的元素先出队列。 数据结构应该提供两个最基本的操作&#xff0c; 一个是返回最高优先级对象&#xff0c; 一个是添加新的对象。 这种数据结构就是优…

第四十六章 命名空间和数据库 - 系统提供的数据库

文章目录 第四十六章 命名空间和数据库 - 系统提供的数据库系统提供的数据库ENSLIBIRISAUDITIRISLIBIRISLOCALDATAIRISSYS (the system manager’s database 系统管理器的数据库)IRISTEMP 第四十六章 命名空间和数据库 - 系统提供的数据库 系统提供的数据库 IRIS 提供以下数据…

使用华为eNSP组网试验⑷-OSPF多区域组网

今天进行了OSPF的多区域组网试验&#xff0c;本来这是个很简单的操作&#xff0c;折腾了好长时间&#xff0c;根本原因只是看了别人写的配置代码&#xff0c;没有真正弄明白里面对应的规则。 一般情况下&#xff0c;很多单位都使用OSPF进行多区域的组网&#xff0c;大体分为1个…