pyinstaller FileNotFoundError: [Errno 2] No such file or directory: ‘\\python37.zip\\struct.pyc’

执行pyinstaller -F -c chicun.py ,这个问题困扰了我三天时间,试了各种方法。

报错信息如下:

356 INFO: PyInstaller: 5.4.1
356 INFO: Python: 3.7.9
356 INFO: Platform: Windows-10-10.0.22621-SP0
358 INFO: wrote C:\Users\Administrator\Desktop\chicun.spec
361 INFO: UPX is not available.
362 INFO: Extending PYTHONPATH with paths
[‘C:\\Users\\Administrator\\Desktop’]
878 INFO: checking Analysis
Traceback (most recent call last):
File “D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\runpy.py”, line 193, in _run_module_as_main
File “D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\runpy.py”, line 85, in _run_code
File “D:\Program Files\python-3.7.9\Scripts\pyinstaller.exe\__main__.py”, line 7, in <module>
File “D:\Program Files\python-3.7.9\lib\site-packages\PyInstaller\__main__.py”, line 179, in run
run_build(pyi_config, spec_file, **vars(args))
File “D:\Program Files\python-3.7.9\lib\site-packages\PyInstaller\__main__.py”, line 60, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File “D:\Program Files\python-3.7.9\lib\site-packages\PyInstaller\building\build_main.py”, line 962, in main
build(specfile, distpath, workpath, clean_build)
File “D:\Program Files\python-3.7.9\lib\site-packages\PyInstaller\building\build_main.py”, line 884, in build
exec(code, spec_namespace)
File “C:\Users\Administrator\Desktop\chicun.spec”, line 22, in <module>
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
File “D:\Program Files\python-3.7.9\lib\site-packages\PyInstaller\building\api.py”, line 102, in __init__
pyc_path = compile_pymodule(name, src_path, workpath, code_cache=None)
File “D:\Program Files\python-3.7.9\lib\site-packages\PyInstaller\building\utils.py”, line 727, in compile_pymodule
with open(src_path, ‘rb’) as fp:
FileNotFoundError: [Errno 2] No such file or directory: ‘D:\\Program Files\\python-3.7.9\\python37.zip\\struct.pyc’

如图:

pyinstaller FileNotFoundError: [Errno 2] No such file or directory: ‘\\python37.zip\\struct.pyc’-完美源码

原因是安装的Windows embeddable package (64-bit) 缺少环境。

解决方法:

安装Windows installer (64-bit)      .exe版本,默认安装即可,小编是全选安装了,为了以后开发,如图:

pyinstaller FileNotFoundError: [Errno 2] No such file or directory: ‘\\python37.zip\\struct.pyc’-完美源码

再次编译,successfully OK

pyinstaller FileNotFoundError: [Errno 2] No such file or directory: ‘\\python37.zip\\struct.pyc’-完美源码

END
如本资源侵犯了您的权益,请联系投诉邮箱admin@wmphp.com进行举报!我们将在收到邮件的1个小时内处理完毕。 本站仅为平台,发布的资源均为用户投稿或转载!所有资源仅供参考学习使用,请在下载后的24小时内删除,禁止商用! Wmphp.com(完美源码)助力正版,如您有自己的原创产品,可以联系客服投稿,代理出售! Wmphp.com(完美源码)客服QQ:136882447 Wmphp.com(完美源码)商务电话(仅对企业客户/个人用户):15120086569 (微信同步) 请注意:本站不提供任何免费的技术咨询服务,为了节约时间,下载前 请确认自己会技术
完美源码 » pyinstaller FileNotFoundError: [Errno 2] No such file or directory: ‘\\python37.zip\\struct.pyc’
2981+

本站勉强运行

1536+

用户总数

672+

资源总数

0+

今日更新

2022-11-27

最后更新时间