在我们打包的时候:如果是直接指定python文件进行pyinstaller打包的话,如果没有指定路径,需要进入打包文件的目录下执行下面命令,否则还得加上文件路径才能打包。
方法一:pyinstaller -F mycode.py --noconsole
方法二:pyinstaller -F -w mycode.py (-w就是取消窗口)
方法三:pyinstaller --distpath Release/ -w -i x.ico --clean mycode.py(-w就是取消窗口 带图标的 Release版)
在用pyinstaller打包exe,运行出现RuntimeError: Could not find the matplotlib data files
卸载,重装matplotlib
pip uninstall matplotlib
pip install matplotlib==3.1.1
找到程序的.spec文件修改 hiddenimports=[‘matplotlib’],
ok,弄好之后重新打包
pyinstaller -F XXX.py
再执行时,会出现warning,但是不影响结果~
已有 1 条评论