python 打包exe 文件 使用 pyinstaller的坑

python用pyinstaller生成exe时报错:

126 INFO: PyInstaller: 3.5
126 INFO: Python: 3.8.0
126 INFO: Platform: Windows-10-10.0.15063-SP0
128 INFO: wrote C:\report\ToExe\pywin32-217\pywin32-217\TestHandler.spec
130 INFO: UPX is not available.
133 INFO: Extending PYTHONPATH with paths
[‘C:\report\ToExe\pywin32-217\pywin32-217’,
‘C:\report\ToExe\pywin32-217\pywin32-217’]
133 INFO: checking Analysis
199 INFO: checking PYZ
199 INFO: Building PYZ because PYZ-00.toc is non existent
201 INFO: Building PYZ (ZlibArchive) C:\report\ToExe\pywin32-217\pywin32-217\build\TestHandler\PYZ-00.pyz
Traceback (most recent call last):
File “c:\python\python38-32\lib\runpy.py”, line 192, in run_module_as_main
return run_code(code, main_globals, None,
File “c:\python\python38-32\lib\runpy.py”, line 85, in run_code
exec(code, run_globals)
File “C:\Python\Python38-32\Scripts\pyinstaller.exe_main.py”, line 7, in
File “c:\python\python38-32\lib\site-packages\PyInstaller_main.py”, line 111, in run
run_build(pyi_config, spec_file, **vars(args))
File “c:\python\python38-32\lib\site-packages\PyInstaller_main.py”, line 63, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File “c:\python\python38-32\lib\site-packages\PyInstaller\building\build_main.py”, line 844, in main
build(specfile, kw.get(‘distpath’), kw.get(‘workpath’), kw.get(‘clean_build’))
File “c:\python\python38-32\lib\site-packages\PyInstaller\building\build_main.py”, line 791, in build
exec(code, spec_namespace)
File “C:\report\ToExe\pywin32-217\pywin32-217\TestHandler.spec”, line 18, in
pyz = PYZ(a.pure, a.zipped_data,
File “c:\python\python38-32\lib\site-packages\PyInstaller\building\api.py”, line 98, in init
self.postinit()
File “c:\python\python38-32\lib\site-packages\PyInstaller\building\datastruct.py”, line 158, in postinit
self.assemble()
File “c:\python\python38-32\lib\site-packages\PyInstaller\building\api.py”, line 128, in assemble
self.code_dict = {
File “c:\python\python38-32\lib\site-packages\PyInstaller\building\api.py”, line 129, in
key: strip_paths_in_code(code)
File “c:\python\python38-32\lib\site-packages\PyInstaller\building\utils.py”, line 652, in strip_paths_in_code
consts = tuple(
File “c:\python\python38-32\lib\site-packages\PyInstaller\building\utils.py”, line 653, in
strip_paths_in_code(const_co, new_filename)
File “c:\python\python38-32\lib\site-packages\PyInstaller\building\utils.py”, line 660, in strip_paths_in_code
return code_func(co.co_argcount, co.co_kwonlyargcount, co.co_nlocals, co.co_stacksize,
TypeError: an integer is required (got type bytes)

在网上找了好久 终于找到错误原因 :
原因 是使用pip install pyinstaller 直接安装的不能使用 需要通过 pip 网址安装
pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz

后面又遇到 一个坑ERROR: HTTP error 404 while getting https://github.com/pyinstaller/pyinstaller/archive/develop.tar.g
ERROR: Could not install requirement https://github.com/pyinstaller/pyinstaller/archive/develop.tar.g because of error 404 Client Error: Not Found for url: https://github.com/pyinstaller/pyinstaller/archive/develop.tar.g
ERROR: Could not install requirement https://github.com/pyinstaller/pyinstaller/archive/develop.tar.g because of HTTP error 404 Client Error: Not Found for url: https://github.com/pyinstaller/pyinstaller/archive/develop.tar.g for URL https://github.com/pyinstaller/pyinstaller/archive/develop.tar.g

原因是 直接把网址 打错了 后面少打一个字母z
发次博文谨记

原文链接:https://blog.csdn.net/chen_soldier/article/details/102667201

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值