关于pyinstaller一些问题个人解决方法

1. UnicodeDecodeError: 'utf8' codec can't decode byte 0xce in position 47: invalid continuation byte
 1.找到报错文件和报错位置,把encoding改为 "ISO-8859-1"
 2.命令行输入 chcp 65001
最后 pyinstaller -F 文件地址+文件名

2. 需要装的依赖包有:
 
 pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyqt5
 pip install -U pillow
 pip install skimage

3.pyinstaller 打包后运行exe程序出现的"ModuleNotFindError":
 使用pyinstaller 打包生成”.spec” 文件


 接下来,使用文本编辑器打开”.spec”文件,在  hiddenimport=[]
 部分添加缺少的module,
 我的程序中缺少的是 pywt 模块,因而添加:

 hiddenimports=[
'skimage.io._plugins','pywt','pywt._extensions._cwt']
 然后使用pyinstaller 生成新的exe程序:

 pyinstaller my.spec
参考:

https://blog.csdn.net/zyc121561/article/details/79562935

展开阅读全文

请教关于pyinstaller的使用

08-31

最近开发了一个wxpython程序,想打包成exe给别人使用,在网上搜了下pyinstaller,安装了,能正常打包,命令:rnpyinstaller -F -p core;tools;utils;parser;server --clean autotest_test_page.pyrn运行exe后报错:rn File "autotest_construct\autotest_test_page.py", line 15, in rn File "c:\users\admini~1\appdata\local\temp\pip-build-v9txzy\pyinstaller\PyInstrnller\loader\pyimod03_importers.py", line 389, in load_modulern File "autotest_construct\core\send_command.py", line 28, in rn from django.shortcuts import get_object_or_404rn File "c:\users\admini~1\appdata\local\temp\pip-build-v9txzy\pyinstaller\PyInstrnller\loader\pyimod03_importers.py", line 389, in load_modulern File "site-packages\django\shortcuts.py", line 9, in rn File "c:\users\admini~1\appdata\local\temp\pip-build-v9txzy\pyinstaller\PyInstrnller\loader\pyimod03_importers.py", line 389, in load_modulern File "site-packages\django\core\urlresolvers.py", line 17, in rn File "c:\users\admini~1\appdata\local\temp\pip-build-v9txzy\pyinstaller\PyInstrnller\loader\pyimod03_importers.py", line 389, in load_modulern File "site-packages\django\http\__init__.py", line 1, in rnrn File "c:\users\admini~1\appdata\local\temp\pip-build-v9txzy\pyinstaller\PyInstrnller\loader\pyimod03_importers.py", line 389, in load_modulern File "site-packages\django\http\cookie.py", line 7, in rn File "site-packages\django\utils\six.py", line 203, in load_modulern File "site-packages\django\utils\six.py", line 115, in _resolvern File "site-packages\django\utils\six.py", line 82, in _import_modulernmportError: No module named Cookiernailed to execute script autotest_test_pagernrnpyinstalerl文件升级到最新的3.2版本了, 尝试了注释所有的django相关的代码,打包运行是正常的。rn我又试了下 pyinstaller -F -p core;tools;utils;parser;server --hidden-import=Cookie;django.utils.six --clean autotest_test_page.py。还是报相同的错误,希望大家多多指教~~rnrn还有个问题,程序中使用的资源文件打包后都到用户的temp文件下了,这个怎么附加处理? 论坛

没有更多推荐了,返回首页