53 Command “python setup.py egg_info“ failed with error

2023-05-16

53.1 引言

今天在Ubuntu环境下搭建安信科技的ESP8266开发环境,到配置这一步骤时出现了,一个问题,网上一顿查阅,然后并没有实际解决,后面查到外文blog外国朋友遇到跟我一样的问题,参考他的做法才解决,特此记录,弥补中文博客对该问题解决方案的完整性不足问题。

53.2 问题

配置编译问题如下所示:

qihua@qihua-virtual-machine:~/esp/setuptools-19.2$ sudo pip install setuptools -U
The directory '/home/qihua/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/qihua/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting setuptools
  Downloading https://files.pythonhosted.org/packages/1e/5c/3d7b3d91a86d71faf5038c5d259ed36b5d05b7804648e2c43251d574a6e6/setuptools-58.2.0.tar.gz (2.3MB)
    100% |████████████████████████████████| 2.3MB 830kB/s 
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "setuptools/__init__.py", line 16, in <module>
        import setuptools.version
      File "setuptools/version.py", line 1, in <module>
        import pkg_resources
      File "pkg_resources/__init__.py", line 1367
        raise SyntaxError(e) from e
                                ^
    SyntaxError: invalid syntax
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-H1VVcQ/setuptools/
You are using pip version 8.1.1, however version 21.2.4 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

根据上述提示,是pip这个工具版本太低导致的,只要运行pip相关的命令就会出错。

sudo python -m pip install --user -r $IDF_PATH/requirements.txt
The directory '/home/qihua/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/qihua/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied (use --upgrade to upgrade): setuptools in /home/qihua/esp/setuptools-19.2 (from -r /home/qihua/esp/ESP8266_RTOS_SDK/requirements.txt (line 4))
Collecting click>=5.0 (from -r /home/qihua/esp/ESP8266_RTOS_SDK/requirements.txt (line 8))
  Downloading https://files.pythonhosted.org/packages/21/83/308a74ca1104fe1e3197d31693a7a2db67c2d4e668f20f43a2fca491f9f7/click-8.0.1.tar.gz (327kB)
    100% |████████████████████████████████| 327kB 538kB/s 
    Complete output from command python setup.py egg_info:
    error in click setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Expected version spec in colorama; platform_system == 'Windows' at ; platform_system == 'Windows'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-iqFjPF/click/
You are using pip version 8.1.1, however version 21.2.4 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

但是按照提示,执行升级更新指令:pip install --upgrade pip  后,并没啥用,没有更新到。

53.3 解决

经过一顿查阅,自动升级pip的命令(如下),没有成功,可能只是匹配当前环境用到的版本而已。

pip install --upgrade pip

然后用指定升级版本的方法,让pip升级到高版本就行了,命令如下:

pip install --upgrade pip==20.3

升级了pip之后,我顺便把setuptools工具也升级了。

qihua@qihua-virtual-machine:~/esp/setuptools-19.2$ python -m pip install --upgrade setuptools
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.
Defaulting to user installation because normal site-packages is not writeable
Collecting setuptools
  Downloading setuptools-44.1.1-py2.py3-none-any.whl (583 kB)
     |████████████████████████████████| 583 kB 231 kB/s 
Installing collected packages: setuptools
Successfully installed setuptools-44.1.1
WARNING: You are using pip version 20.3; however, version 20.3.4 is available.
You should consider upgrading via the '/usr/bin/python -m pip install --upgrade pip' command.

最后,问题解决了!!

qihua@qihua-virtual-machine:~/esp/setuptools-19.2$ sudo python -m pip install --user -r $IDF_PATH/requirements.txt
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.
WARNING: The directory '/home/qihua/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: setuptools in /usr/local/lib/python2.7/dist-packages/setuptools-19.2-py2.7.egg (from -r /home/qihua/esp/ESP8266_RTOS_SDK/requirements.txt (line 4)) (19.2)
Collecting click>=5.0
  Downloading click-7.1.2-py2.py3-none-any.whl (82 kB)
     |████████████████████████████████| 82 kB 207 kB/s 
Requirement already satisfied: pyserial>=3.0 in /usr/lib/python2.7/dist-packages (from -r /home/qihua/esp/ESP8266_RTOS_SDK/requirements.txt (line 9)) (3.0.1)
Collecting future>=0.15.2
  Downloading future-0.18.2.tar.gz (829 kB)
     |████████████████████████████████| 829 kB 363 kB/s 
Collecting cryptography>=2.1.4
  Downloading cryptography-3.3.2-cp27-cp27mu-manylinux2010_x86_64.whl (2.6 MB)
     |████████████████████████████████| 2.6 MB 8.0 MB/s 
Collecting pyparsing<2.4.0,>=2.0.3
  Downloading pyparsing-2.3.1-py2.py3-none-any.whl (61 kB)
     |████████████████████████████████| 61 kB 19.0 MB/s 
Collecting pyelftools>=0.22
  Downloading pyelftools-0.27-py2.py3-none-any.whl (151 kB)
     |████████████████████████████████| 151 kB 34.7 MB/s 
Collecting enum34; python_version < "3"
  Downloading enum34-1.1.10-py2-none-any.whl (11 kB)
Collecting six>=1.4.1
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting ipaddress; python_version < "3"
  Downloading ipaddress-1.0.23-py2.py3-none-any.whl (18 kB)
Collecting cffi>=1.12
  Downloading cffi-1.14.6-cp27-cp27mu-manylinux1_x86_64.whl (389 kB)
     |████████████████████████████████| 389 kB 12.1 MB/s 
Collecting pycparser
  Downloading pycparser-2.20-py2.py3-none-any.whl (112 kB)
     |████████████████████████████████| 112 kB 18.2 MB/s 
Building wheels for collected packages: future
  Building wheel for future (setup.py) ... done
  Created wheel for future: filename=future-0.18.2-py2-none-any.whl size=504728 sha256=b1326b708e930fd621e0c6b869c09994de1f05597255e33694647dcdb71475df
  Stored in directory: /tmp/pip-ephem-wheel-cache-lty8At/wheels/5f/11/0c/aad680baf5ef4fbcbab992c9f03e1130357e0c173a4fdabfff
Successfully built future
Installing collected packages: click, future, enum34, six, ipaddress, pycparser, cffi, cryptography, pyparsing, pyelftools
  WARNING: The scripts futurize and pasteurize are installed in '/home/qihua/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed cffi-1.14.6 click-7.1.2 cryptography-3.3.2 enum34-1.1.10 future-0.18.2 ipaddress-1.0.23 pycparser-2.20 pyelftools-0.27 pyparsing-2.3.1 six-1.16.0
WARNING: You are using pip version 20.3; however, version 20.3.4 is available.
You should consider upgrading via the '/usr/bin/python -m pip install --upgrade pip' command.

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

53 Command “python setup.py egg_info“ failed with error 的相关文章

  • 2d 图像点和 3d 网格之间的交点

    Given 网格 源相机 我有内在和外在参数 图像坐标 2d Output 3D 点 是从相机中心发出的光线穿过图像平面上的 2d 点与网格的交点 我试图找到网格上的 3d 点 This is the process From Multip
  • 为什么我的混淆矩阵只返回一个数字?

    我正在做二元分类 每当我的预测等于事实时 我发现sklearn metrics confusion matrix返回单个值 难道没有问题吗 from sklearn metrics import confusion matrix print
  • 将 yerr/xerr 绘制为阴影区域而不是误差线

    在 matplotlib 中 如何将误差绘制为阴影区域而不是误差条 例如 而不是 忽略示例图中各点之间的平滑插值 这需要进行一些手动插值 或者只是获得更高分辨率的数据 您可以使用pyplot fill between https matpl
  • 如何删除 PyCharm 中的项目?

    如果我关闭一个项目 然后删除该项目文件夹 则在 PyCharm 重新启动后 会再次创建一个空的项目文件夹 只需按顺序执行以下步骤即可 他们假设您当前在 PyCharm 窗口中打开了该项目 单击 文件 gt 关闭项目 关闭项目 在 PyCha
  • 从字典的元素创建 Pandas 数据框

    我正在尝试从字典创建一个 pandas 数据框 字典设置为 nvalues y1 1 2 3 4 y2 5 6 7 8 y3 a b c d 我希望数据框仅包含 y1 and y2 到目前为止我可以使用 df pd DataFrame fr
  • 如何使用 python 的 http.client 准确读取一个响应块?

    Using http client在 Python 3 3 或任何其他内置 python HTTP 客户端库 中 如何一次读取一个分块 HTTP 响应一个 HTTP 块 我正在扩展现有的测试装置 使用 python 编写 http clie
  • McNemar 在 Python 中的测试以及分类机器学习模型的比较 [关闭]

    Closed 此问题正在寻求书籍 工具 软件库等的推荐 不满足堆栈溢出指南 help closed questions 目前不接受答案 有没有用 Python 实现的好的 McNemar 测试 我在 Scipy stats 或 Scikit
  • 如何调整 matplotlib 单选按钮的大小和纵横比?

    我已经尝试了几个小时来使简单的单选按钮列表的大小和纵横比正确 但没有成功 首先 导入模块 import matplotlib pyplot as plt from matplotlib widgets import RadioButtons
  • 指示电子邮件的类型

    我有以下自动化程序 它将电子邮件发送给我自己 并添加了特定的链接 import win32com client as win32 import easygui import tkinter as to from tkinter import
  • 使用 Python 3 动态插入到 sqlite

    我想使用 sqlite 写入多个表 但我不想提前手动指定查询 有数十种可能的排列 例如 def insert sqlite tablename data list global dbc dbc execute insert into tab
  • 检查 python 中命令行参数的数量

    我是蟒蛇新手 还是把脚弄湿了 我正在尝试做这样的事情 import sys if len sys argv lt 3 or lt len sys argv gt 3 print This script will compare two fi
  • NumPy 相当于 Keras 函数 utils.to_categorical

    我有一个使用 Keras 进行机器学习的 Python 脚本 我正在构建 X 和 Y 它们分别是特征和标签 标签的构建方式如下 def main depth 10 nclass 101 skip True output True video
  • 为什么这个 if 语句会导致语法错误

    我正在尝试设置一个 elif 语句 如果用户按下 Enter 键 代码将继续 但是我不断遇到语法错误 GTIN 0 while True try GTIN int input input your gtin 8 number if len
  • 无法在 PyCharm 版本 9.3.3 中安装 NumPy。 Python版本3.8.2

    在 PyCharm 中安装 NumPy 时出错 尝试安装 Microsoft Visual C 14 0 还是行不通 NumPy 正在通过命令安装pip3 install numpy在 cmd 终端中 但是当尝试将其安装在 PyCharm
  • numpy polyfit 中使用的权重值是多少以及拟合误差是多少

    我正在尝试对 numpy 中的某些数据进行线性拟合 Ex 其中 w 是该值的样本数 即对于点 x 0 y 0 我只有 1 个测量值 该测量值是2 2 但对于这一点 1 1 我有 2 个测量值 值为3 5 x np array 0 1 2 3
  • 非法指令:MacOS High Sierra 上有 4 条指令

    我正在尝试在 pygame 3 6 中制作一个看起来像聊天的窗口 我刚刚将我的 MacBook 更新到版本 10 13 6 在我这样做之前它工作得很好 但在我收到消息之后 非法指令 4 Code import pygame from pyg
  • 高效创建抗锯齿圆形蒙版

    我正在尝试创建抗锯齿 加权而不是布尔 圆形掩模 以制作用于卷积的圆形内核 radius 3 no of pixels to be 1 on either side of the center pixel shall be decimal a
  • Jupyter Notebook:带有小部件的交互式绘图

    我正在尝试生成一个依赖于小部件的交互式绘图 我遇到的问题是 当我使用滑块更改参数时 会在前一个绘图之后完成一个新绘图 而我预计只有一个绘图会根据参数发生变化 Example from ipywidgets import interact i
  • 如何使用xlwt设置文本颜色

    我无法找到有关如何设置文本颜色的文档 在 xlwt 中如何完成以下操作 style xlwt XFStyle bold font xlwt Font font bold True style font font background col
  • 使用 paramiko 运行 Sudo 命令

    我正在尝试执行sudo使用 python paramiko 在远程计算机上运行命令 我尝试了这段代码 import paramiko ssh paramiko SSHClient ssh set missing host key polic

随机推荐

  • vins-fusion环境配置,解决opencv3->4的cv::bridge问题

    本文主要介绍如何搭建vins fusion的运行环境 xff0c 以及解决vins fusion编译运行时遇到的环境冲突问题 xff0c 并在此基础上实现例程的运行 本文是在已经安装好 ROS 的基础上 xff0c 在 Ubuntu20 0
  • 解决ROS编译过程中的简单的环境问题

    一 rosmake ERROR No arguments could be parsed into valid package or stack names 该错误是因为找不到工作目录路径 xff0c 设置为当前绝对路径名即可 xff0c
  • 《headfirst设计模式》读书笔记9-迭代器和组合模式

    目录 1 封装遍历2 定义迭代器模式2 1 部分源码2 1 1 MenuItem h2 1 2 Menu h2 1 3 Iterator h2 1 4 ArrayIterator h2 1 5 ArrayIterator cpp2 1 6
  • 【论文笔记】Stereo Camera Localization in 3D LiDAR Maps

    论文笔记 Stereo Camera Localization in 3D LiDAR Maps 随着 3D 光探测和测距 LiDAR 传感器的出现 xff0c 同步定位和映射 SLAM 技术蓬勃发展 xff0c 因此准确的 3D 地图很容
  • C盘有哪些软件可以删除呀

    今天下载QQ群里面的文件 xff0c 电脑居然弹窗 磁盘空间不足 xff0c 我心头一痛 我不是上个月才清过的吗 xff1f xff01 好吧 xff0c 那再来一次 这是我删了一通之后的C盘状态 xff1a 是不是还是很满 xff1f 没
  • Kubernetes-集群结合普罗米修斯、监控nginx、hpa动态伸缩

    目录 xff1a Prometheus简介一 k8s集群部署Prometheus二 Prometheus监控应用nginx三 prometheus实现k8s集群的hpa动态伸缩 Prometheus简介 Prometheus 是由 Soun
  • antd的Form表单如何取到表单里的数据以及如何设置默认值

    获取表单数据 第一步创建ref实例 span class token comment 在render外面 xff0c 类里面就可以 span formRef span class token operator 61 span React s
  • linux知识点——CMakeLists.txt常见指令

    demo1 单文件 只有一个main cpp的情况 main cpp span class token macro property span class token directive hash span span class token
  • 架构师面试问题

    架构师面试问题 xff1a 如何设计高可用 如何设计高并发 如何设计高扩展 如何jvm调优及管控 如何复用及重构 1 使用那些设计模式解决生产中的问题 2 架构选型过程考虑 3 如何保证开发的代码质量实践及减少生产问题 4 如何保证稳定性
  • dockerfile基础介绍

    dockerfile 官网 xff1a https docs docker com engine reference builder 构建三步骤 编写Dockerfile文件docker build命令构建镜像docker run依镜像运行
  • 从prometheus生态系统组件到集成Java开发

    Prometheus介绍 Prometheus是最初在SoundCloud上构建的开源系统监视和警报工具包 于2016年加入了 Cloud Native Computing Foundation xff0c 这是继Kubernetes之后的
  • c++继承和多态

    文章目录 一 继承访问权限测试设计类A具有public protected private等不同属性的成员函数或变量 xff1b 类B通过public protected private等不同方式继承A xff0c 在类B的成员函数中测试访
  • DockerFile定义

    1 何为Dockerfile xff1f Dockerfile是用来构建Docker镜像的文本文件 xff0c 是由一条条构建镜像所需的指令和参数构成的脚本 2 构建三步骤 编写Dockerfile文件 docker build命令构建镜像
  • 死锁的成因及其解决办法

    x1f512 一 什么是死锁 死锁就是两个或者两个以上的线程在执行过程中 由于资源竞争或者由于彼此通信而造成的阻塞现象 若无外力作用 都将无法推进下去 二 关于死锁的情况 x1f937 情况 一个线程 一把锁 如果是可重入锁不会产生死锁 不
  • Ubuntu 18.04 配置ROS melodic 配置qt包并且建立基础pub界面

    建立工作空间 mkdir p ros gui demo src cd ros pkg src sudo apt get install ros melodic qt create sudo apt get install ros melod
  • RFID 负载调制和反向散射调制

    我用我质朴的语言概述一下我的理解 xff0c 射频识别系统中 xff0c 阅读器和标签之间的通信通过电磁波来实现 按照通信距离 xff0c 可以划分为近场和远场 xff1b 按照频率又分 xff1a 低频 高频 超高频 相应的 xff0c
  • ubuntu虚拟机上配置深度学习环境

    学习笔记 xff0c 主要是记录自己目前进行的操作 xff0c 以便自己回顾 xff0c 各位大佬有指导意见也欢迎交流啊 一 安装miniconda Linux下安装miniconda linux 安装miniconda 摸鱼肥仔的博客 C
  • 如何创建一个项目(学习笔记)

    前言 xff1a 欢迎来到本次教程 这篇文章旨在深入解析在 B 站上的 Vue3 后台管理项目 xff0c 同时也为您提供了创建此类项目的实践思路 我们将通过这个笔记系统地梳理一个项目的整体框架 xff0c 涵盖了我们在 Vue 课程中学习
  • PX4学习之uorb

    PX4学习之uorb 1线程 1 1优点 在Linux系统下 xff0c 启动一个新的进程必须分配给它独立的地址空间 xff0c 建立众多的数据表来维护它的代码段 堆栈段和数据段 xff0c 这是一种 34 昂贵 34 的多任务工作方式 而
  • 53 Command “python setup.py egg_info“ failed with error

    53 1 引言 今天在Ubuntu环境下搭建安信科技的ESP8266开发环境 xff0c 到配置这一步骤时出现了 xff0c 一个问题 xff0c 网上一顿查阅 xff0c 然后并没有实际解决 xff0c 后面查到外文blog外国朋友遇到跟