当前位置: 首页 > news >正文

友善Nona Pi开发板ubuntu22.04系统用Python3.8.17的pip安装PyQt5.15.2时报错“Q_PID”这个宏未定义的一种解决办法

安装命令:

pip install PyQt5==5.15.2 --config-settings --confirm-license= --verbose -i https://mirrors.aliyun.com/pypi/simple/

遇到出错:

如图:

分析具体错误内容:
 

  These bindings will be built: Qt, QtCore, QtNetwork, QtGui, QtWidgets, QtDBus, QtSql, QtXml, _QOpenGLFunctions_ES2, pylupdate, pyrcc.Generating the Qt bindings..._in_process.py: /tmp/pip-install-asecfkf9/pyqt5_19c1396a09f04101828420ed5f54c179/sip/QtCore/qprocess.sip: line 99: column 5: 'Q_PID' is undefinederror: subprocess-exited-with-error× Preparing metadata (pyproject.toml) did not run successfully.│ exit code: 1╰─> See above for output.note: This error originates from a subprocess, and is likely not a problem with pip.full command: /home/pi/anaconda3/envs/py38qt5/bin/python /home/pi/anaconda3/envs/py38qt5/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpvs7_f0g7cwd: /tmp/pip-install-asecfkf9/pyqt5_19c1396a09f04101828420ed5f54c179Preparing metadata (pyproject.toml) ... error
error: metadata-generation-failed× Encountered error while generating package metadata.
╰─> See above for output.note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

解决办法:打开/sip/QtCore/qprocess.sip这个文件,除过30行,删除23—32之间的行:

我的解决办法是:
先用WinScp进入开发板的 /tmp目录,然后执行安装命令,立即刷新此目录, 找到最新的一个以“pip-install-*”开头的子目录,然后依次进入/pyqt5_****/sip/QtCore/子目录,找到qprocess.sip,把这个文件拖到本地,修改好后,再拖到开发板中覆盖。
如果仍然提示错误,说明你手太慢。重来一遍,手速够快的话就不报错了。

经过漫长的等待,发现PyQt5.15.2安装成功了。
 

http://www.lryc.cn/news/167901.html

相关文章:

  • HTML中name和class,id的区别和联系
  • Google 开源库Guava详解(集合工具类)—Maps、Multisets、Multimaps
  • 肖sir__mysql之介绍__001
  • 【实战项目开发技术分享】如何设置机器人禁行区/虚拟墙
  • 每日一题~中序后序遍历构造二叉树
  • Sentinel整合Gateway
  • 线性dp,优化,272. 最长公共上升子序列
  • 基于Java+SpringBoot+Vue+uniapp点餐小程序(包含协同过滤算法和会员系统,强烈推荐!)
  • ActiveMQ面试题(二)
  • 解决Oracle SQL语句性能问题——SQL语句改写(in、not in、exists及not exists)
  • 列表对象复制属性到另一个列表对象 从List<Object>另一个List<Object>
  • Python基本情况
  • 【精华】AI Agent:大模型改变世界的“钥匙”
  • CVPR2023 RIFormer, 无需TokenMixer也能达成SOTA性能的极简ViT架构
  • 瑞萨MCU入门教程(非常详细的瑞萨单片机入门教程)
  • 【Java】采用 Tabula 技术对 PDF 文件内表格进行数据提取
  • 完全保密的以太坊交易:Aztec网络的隐私架构
  • 初识Java 9-1 内部类
  • 合宙Air724UG LuatOS-Air LVGL API控件-屏幕横屏竖屏切换(Rotation)
  • 在Unity中,Instantiate函数用于在场景中创建一个新的游戏对象实例
  • 解决 tesserocr报错 Failed to init API, possibly an invalid tessdata path : ./
  • 使用Python CV2融合人脸到新图片--优化版
  • Python分享之对象的属性
  • 编程参考 - std::exchange和std::swap的区别
  • Sentinel整合RestTemplate
  • 微前端学习(下)
  • Android Splash实现
  • FPGA projet : VGA
  • JDK8 升级至JDK19
  • Python3.10 IDLE更换主题