树莓派4 ubuntu20.04安装PyInstaller
1、正常情况下,我们是通过pip3来安装PyInstaller,但是在树莓派的ubuntu20.04上安装时,会报错如下:
In function ‘strncpy’,inlined from ‘splitName’ at ../../src/pyi_launch.c:83:5,inlined from ‘_extract_dependency’ at ../../src/pyi_launch.c:215:9:/usr/include/aarch64-linux-gnu/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound 4097 equals destination size [-Werror=stringop-truncation]106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~cc1: all warnings being treated as errorsIn file included from /usr/include/string.h:495,from ../../src/pyi_utils.c:60:In function ‘strncpy’,inlined from ‘pyi_open_target’ at ../../src/pyi_utils.c:561:5:/usr/include/aarch64-linux-gnu/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound 4096 equals destination size [-Werror=stringop-truncation]106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~In function ‘strncpy’,inlined from ‘pyi_open_target’ at ../../src/pyi_utils.c:562:5:/usr/include/aarch64-linux-gnu/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound 4096 equals destination size [-Werror=stringop-truncation]106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~cc1: all warnings being treated as errorsIn file included from /usr/include/string.h:495,from ../../src/pyi_pythonlib.c:39:In function ‘strncpy’,inlined from ‘pyi_pylib_start_python’ at ../../src/pyi_pythonlib.c:487:9:/usr/include/aarch64-linux-gnu/bits/string_fortified.h:106:10: error: ‘__builtin___strncpy_chk’ output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation]106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~In function ‘strncat’,inlined from ‘pyi_pylib_start_python’ at ../../src/pyi_pythonlib.c:491:9:/usr/include/aarch64-linux-gnu/bits/string_fortified.h:136:10: error: ‘__builtin___strncat_chk’ output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation]136 | return __builtin___strncat_chk (__dest, __src, __len, __bos (__dest));| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~../../src/pyi_pythonlib.c: In function ‘pyi_pylib_start_python’:../../src/pyi_pythonlib.c:491:9: note: length computed here491 | strncat(pypath, status->mainpath, strlen(status->mainpath));| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~In file included from /usr/include/string.h:495,from ../../src/pyi_pythonlib.c:39:In function ‘strncpy’,inlined from ‘pyi_pylib_start_python’ at ../../src/pyi_pythonlib.c:483:9:/usr/include/aarch64-linux-gnu/bits/string_fortified.h:106:10: error: ‘__builtin___strncpy_chk’ output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation]106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~cc1: all warnings being treated as errorsIn file included from /usr/include/string.h:495,from ../../src/pyi_path.c:38:In function ‘strncpy’,inlined from ‘pyi_path_join’ at ../../src/pyi_path.c:146:5:/usr/include/aarch64-linux-gnu/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation]106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~../../src/pyi_path.c: In function ‘pyi_path_join’:../../src/pyi_path.c:146:5: note: length computed here146 | strncpy(result, path1, strlen(path1));| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~In file included from /usr/include/string.h:495,from ../../src/pyi_path.c:38:In function ‘strncat’,inlined from ‘pyi_path_join’ at ../../src/pyi_path.c:159:9:/usr/include/aarch64-linux-gnu/bits/string_fortified.h:136:10: error: ‘__builtin_strncat’ specified bound depends on the length of the source argument [-Werror=stringop-overflow=]136 | return __builtin___strncat_chk (__dest, __src, __len, __bos (__dest));| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~../../src/pyi_path.c: In function ‘pyi_path_join’:../../src/pyi_path.c:155:11: note: length computed here155 | len = strlen(path2);| ^~~~~~~~~~~~~In file included from /usr/include/string.h:495,from ../../src/pyi_path.c:38:In function ‘strncpy’,inlined from ‘pyi_search_path’ at ../../src/pyi_path.c:256:13:/usr/include/aarch64-linux-gnu/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ output may be truncated copying 4096 bytes from a string of length 4096 [-Werror=stringop-truncation]106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~In function ‘strncpy’,inlined from ‘pyi_path_executable’ at ../../src/pyi_path.c:331:13:/usr/include/aarch64-linux-gnu/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound 4096 equals destination size [-Werror=stringop-truncation]106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~cc1: all warnings being treated as errorsWaf: Leaving directory `/tmp/pip-install-1jgb0leb/pyinstaller/bootloader/build/debug'Build failed-> task in 'run_d' failed with exit status 1 (run with -v to display more information)-> task in 'run_d' failed with exit status 1 (run with -v to display more information)-> task in 'run_d' failed with exit status 1 (run with -v to display more information)-> task in 'run_d' failed with exit status 1 (run with -v to display more information)
2、通过错误提示,我们可以分析出来,这里报的错误为Werror,即在用gcc编译时,将警告信息当作错误来处理,并不是真的时运行不下去,所以,我们要做的就是修改makefile,让使用gcc编译的时候,不进行Werror处理;
3、我们从pip官网下载pyinstaller源码
https://pypi.org/project/PyInstaller/
4、将源码解压,打开,尝试直接运行python3 setup.py install ,依旧会报上面的错误,现在重点来了,修改make文件,这里这个make文件也找到了好半天才找到
//进入pyinstaller源码下面的bootloader文件夹cd bootloader//编辑make文件,这里是wscriptvim wscript//通过/Werror查找,我们可以找到在第461,gcc的参数里面有Werror这个参数,直接删除这一行参数就行,注意只删除‘-Werror’这一句//保存退出,返回pyinstaller的根目录//安装就可以了
python3 setup.py install
OK,至此pyinstaller就安装完成了,可以使用他来发布你的QT程序了
树莓派4 ubuntu20.04安装PyInstaller相关推荐
- 树莓派4B——Ubuntu20.04 mate
树莓派4B--Ubuntu20.04 mate 安装操作系统 安装必要的库 安装软件 VNC和SSH 开机启动 问题 安装操作系统 1.从树莓派官网下载镜像烧写工具,点这里,如图选择对应系统地烧写工具 ...
- 优麒麟Ubuntu20.04安装各种问题
优麒麟Ubuntu用了六年了,版本旧了,所以按照20.04版. 1.adobe-flashplugin的安装极其慢 慎重啊!需要好几个小时,无法忍受啊! 2.dpkg被中断的解决方法 关闭掉Ubunt ...
- ubuntu20.04 安装 Qt5.12步骤
转载链接:ubuntu20.04 安装 Qt5.12_仙海寻波的博客-CSDN博客_ubuntu20.04安装qt第一步 下载 Qt5.12.9安装包使用清华镜像进行下载:https://mirror ...
- 了解Docker、Ubuntu20.04安装docker教程
Docker 的前世今生 https://my.oschina.net/u/4126211/blog/4517028 Ubuntu20.04安装docker教程 https://blog.csdn.n ...
- ubuntu20.04安装ROS及常见问题
ubuntu20.04安装ROS及常见问题 一.ubuntu安装参考(双系统) 1.ios镜像官网下载地址: https://releases.ubuntu.com/?_ga=2.239339907. ...
- Ubuntu20.04安装,并Linux微信等
Ubuntu20.04安装,并Linux微信等 一.Ubuntu20.04双硬盘双系统安装 电脑状况:256G+260G双固态硬盘,其中256G(sda)分C.D盘安装win10,460G(sdb)硬 ...
- ubuntu20.04安装小鹤双拼输入法挂接音形改简体中文Rime
ubuntu20.04安装小鹤双拼输入法挂接音形改简体中文Rime 方案1,按照这个挂接方法,原始的繁体等其他的也还在: 替换方案 方案2 修改成默认简体中文: 更改皮肤 设置-区域与语言-改成中文- ...
- 微星主板 Ubuntu20.04安装以及配置
1 设置U盘启动 1)插入使用软碟通制作好的U盘,开机按del键进入BIOS: 2)Boot Option 中 选择U盘启动: 3)设置硬盘BBS(我也不知道是什么): 4)点击左边Settings, ...
- Ubuntu20.04安装NVIDIA显卡驱动、CUDA、CUDNN及突破NVENC并发限制
1.查看当前系统版本 cat /proc/version 显示为: 2.查看当前显卡型号: sudo lshw -numeric -C display 显示我的显卡型号为:GM107M[GeForc ...
最新文章
- oracle系列(三)oracle的配置与管理
- F7-Vue1.0与2.0不兼容列表
- php session 释放,php中删除Session和销毁Session的方法
- Redis的编译安装
- Web前端期末大作业--响应式性感美女模特博客网页设计(HTML+CSS+JavaScript)实现
- SpringCloud工作笔记053---SLF4J简介与使用(整合log4j_并切换logging)
- 文件下的所有文本内容转为一个csv文件代码
- 蓝桥杯 ALGO-37 算法训练 Hankson的趣味题
- Ubuntu硬盘全盘备份tar和clonezilla两种方案
- 微信开发经常会用到的一些方法
- 用“无线诊断”工具解决 Mac 出现的 WiFi 连接问题
- 游戏开发需要懂几种语言?
- c语言万年历查询程序代码,C语言实现万年历程序
- oracle追踪语句,SQL Monitor(oracle语句追踪工具)
- 开源WebGIS开发——栅格图层
- html5制作心路历程,原创到伪原创 心路历程实战技巧
- ps动感映像插件ImageMotion 1.3全新功能介绍
- Autovue v21.0.2的新功能
- 搭建个人网盘-owncloud
- 论学生/战队/社团如何举办CTF比赛