pyinstaller
宇宙全能王
很感谢那些免费回答问题的人,所以我的博客也全部免费,希望能帮助有需要的人!
展开
-
python在虚拟环境运行pyinstaller打包生成exe
如果系统的python包含太多模块,那么用Pyinstaller打包的时候会出很多问题,这个时候需要用到pipenv安装pipenvpip install pipenv安装虚拟环境pipenv install在当前目录下会生成两个文件PipfilePipfile.lock修改虚拟环境里面的源修改Pipfile文件[[source]]url = "https://pypi.tuna.tsinghua.edu.cn/simple"进入虚拟环境pipenv shell开始安装你原创 2021-12-29 13:54:38 · 1024 阅读 · 0 评论 -
pyinstaller spec文件详解
先上spec文件配置好后的全部代码。后面详细讲解!官方详细文档请参阅链接# -*- mode: python ; coding: utf-8 -*-block_cipher = Nonea = Analysis(['hello.py'], pathex=['D:\\Company\\project\\untitled', 'D:\\Company' ], binaries=[( '/usr/原创 2021-12-29 13:48:06 · 7040 阅读 · 4 评论 -
Failed to determine matplotlib‘s data directory
运行下面代码的时候出现以上错误pyinstaller test.spec问题出在spec文件里面的pathex处。没正确填写。解决办法:将main入口的文件所在绝对路径添加到pathex处。比如我的test.py是main入口,所在目录为D:\project,那么就设置pathex为pathex=['D:\\project']...原创 2021-12-29 12:55:41 · 1954 阅读 · 1 评论 -
pyinstaller打包简便方法,可避免no module named *
首先说明,no module named 以下2种解决方案,我都失败了。1:更新pyinstaller到最新版2:重新填写spec文件,加入–hiden-import我用自动生成spec的方法解决了这些问题1:安装pyinstallerpip install pyinstaller2:制作spec脚本pyi-makespec -w yourfile.py3:生成文件包pyinstaller yourfile.spec...原创 2021-08-20 15:13:01 · 2736 阅读 · 0 评论 -
pyinstaller生成的文件太大解决方案
直接输入pyinstaller -Fw file会生成一个100M左右的文件,打开要很久,就算是用from … import这样的语句也差不多。原因就是加了-F生成了一个文件,这样exe添加了很多库。不妨思考一下,安装QQ的时候其实就是生成一大堆文件,在桌面生成快捷方式。所以用pyinstaller的时候不要添加-F,可以用以下完整的命令。pyinstaller --workpath app/build --distpath app --specpath app/spec file.py 路过的坑原创 2020-07-30 15:10:03 · 2010 阅读 · 0 评论