Nuitka打包报错

前言

使用Nuitka打包python项目时发生报错

报错

Nuitka-Plugins:INFO: pyqt5: Found 2 files DLLs from 'OpenSSL' PyQt5 installation.

Nuitka-Inclusion:INFO: Analyzing dependencies of 'app.dist\app.exe'.

Detecting used DLLs: 2.6%|▋ | 1/39, app.exeTraceback (most recent call last):

File "C:\Users\yuai.pyenv\pyenv-win\versions\3.9.4\lib\site-packages\nuitka_main _.py", line 155, in

main()

File "C:\Users\yuai.pyenv\pyenv-win\versions\3.9.4\lib\site-packages\nuitka_main _.py", line 141, in main

MainControl.main()

File "C:\Users\yuai.pyenv\pyenv-win\versions\3.9.4\lib\site-packages\nuitka\MainControl.py", line 1109, in main

_main()

File "C:\Users\yuai.pyenv\pyenv-win\versions\3.9.4\lib\site-packages\nuitka\MainControl.py", line 1012, in _main

detectUsedDLLs(

File "C:\Users\yuai.pyenv\pyenv-win\versions\3.9.4\lib\site-packages\nuitka\freezer\Standalone.py", line 766, in detectUsedDLLs

_detectUsedDLLs(

File "C:\Users\yuai.pyenv\pyenv-win\versions\3.9.4\lib\site-packages\nuitka\freezer\Standalone.py", line 688, in _detectUsedDLLs

used_dlls = _detectBinaryDLLs(

File "C:\Users\yuai.pyenv\pyenv-win\versions\3.9.4\lib\site-packages\nuitka\freezer\Standalone.py", line 593, in _detectBinaryDLLs

return detectBinaryPathDLLsWindowsDependencyWalker(

File "C:\Users\yuai.pyenv\pyenv-win\versions\3.9.4\lib\site-packages\nuitka\freezer\DllDependenciesWin32.py", line 97, in detectBinaryPathDLLsWindowsDependencyWalker

result = detectDLLsWithDependencyWalker(

File "C:\Users\yuai.pyenv\pyenv-win\versions\3.9.4\lib\site-packages\nuitka\freezer\DependsExe.py", line 221, in detectDLLsWithDependencyWalker

result = parseDependsExeOutput(output_filename)

File "C:\Users\yuai.pyenv\pyenv-win\versions\3.9.4\lib\site-packages\nuitka\freezer\DependsExe.py", line 162, in parseDependsExeOutput

return _parseDependsExeOutput2(getFileContentByLine(filename, encoding="latin1"))

File "C:\Users\yuai.pyenv\pyenv-win\versions\3.9.4\lib\site-packages\nuitka\freezer\DependsExe.py", line 154, in _parseDependsExeOutput2

assert os.path.isfile(dll_filename), (dll_filename, line)

AssertionError: ('d:\\x04\x0\x04\x04\x04\\x04\x04\x04\x04\t4\x04\x04\x04\x04\jvms_v~1.5_a\store\jdk11\bin\api-ms-win-crt-runtime-l1-1-0.dll', ' [ ^6] d:\\x04\x04\x04\tools\\x04\x04\x04\x4\x04\x04\jvms_v~1.5_a\store\jdk11\bin\API-MS-WIN-CRT-RUNTIME-L1-1-0.DLL')

bash 复制代码
Nuitka-Plugins:INFO: pyqt5: Found 2 files DLLs from 'OpenSSL' PyQt5 installation.
Nuitka-Inclusion:INFO: Analyzing dependencies of 'app.dist\app.exe'.
Detecting used DLLs: 2.6%|▋                        | 1/39, app.exeTraceback (most recent call last):
  File "C:\Users\yuai\.pyenv\pyenv-win\versions\3.9.4\lib\site-packages\nuitka\__main__.py", line 155, in <module>
    main()
  File "C:\Users\yuai\.pyenv\pyenv-win\versions\3.9.4\lib\site-packages\nuitka\__main__.py", line 141, in main
    MainControl.main()
  File "C:\Users\yuai\.pyenv\pyenv-win\versions\3.9.4\lib\site-packages\nuitka\MainControl.py", line 1109, in main
    _main()
  File "C:\Users\yuai\.pyenv\pyenv-win\versions\3.9.4\lib\site-packages\nuitka\MainControl.py", line 1012, in _main
    detectUsedDLLs(
  File "C:\Users\yuai\.pyenv\pyenv-win\versions\3.9.4\lib\site-packages\nuitka\freezer\Standalone.py", line 766, in detectUsedDLLs
    _detectUsedDLLs(
  File "C:\Users\yuai\.pyenv\pyenv-win\versions\3.9.4\lib\site-packages\nuitka\freezer\Standalone.py", line 688, in _detectUsedDLLs
    used_dlls = _detectBinaryDLLs(
  File "C:\Users\yuai\.pyenv\pyenv-win\versions\3.9.4\lib\site-packages\nuitka\freezer\Standalone.py", line 593, in _detectBinaryDLLs
    return detectBinaryPathDLLsWindowsDependencyWalker(
  File "C:\Users\yuai\.pyenv\pyenv-win\versions\3.9.4\lib\site-packages\nuitka\freezer\DllDependenciesWin32.py", line 97, in detectBinaryPathDLLsWindowsDependencyWalker
    result = detectDLLsWithDependencyWalker(
  File "C:\Users\yuai\.pyenv\pyenv-win\versions\3.9.4\lib\site-packages\nuitka\freezer\DependsExe.py", line 221, in detectDLLsWithDependencyWalker
    result = parseDependsExeOutput(output_filename)
  File "C:\Users\yuai\.pyenv\pyenv-win\versions\3.9.4\lib\site-packages\nuitka\freezer\DependsExe.py", line 162, in parseDependsExeOutput
    return _parseDependsExeOutput2(getFileContentByLine(filename, encoding="latin1"))
  File "C:\Users\yuai\.pyenv\pyenv-win\versions\3.9.4\lib\site-packages\nuitka\freezer\DependsExe.py", line 154, in _parseDependsExeOutput2
    assert os.path.isfile(dll_filename), (dll_filename, line)
AssertionError: ('d:\\\x04\\\x04\x04\x04\x04\\tools\\\x04\x\x04\x04\x04\\jvms_v~1.5_a\\store\\jdk11\\bin\\api-ms-win-crt-runtime-l1-1-0.dll', '               [ ^6] d:\\\x04\x04\x04\x04\x04\x04\x04\x04\\\x04\x04\x04\x04\\tools\\\x04\x04\x04\x04\x04\x04\x04\x04\\jvms_v~1.5_a\\store\\jdk11\\bin\\API-MS-WIN-CRT-RUNTIME-L1-1-0.DLL')

解决方法

发生这种错误的原因是我的Java.exe即我Java环境的路径有特殊字符,如中文。。。。解决方法其实也就是将Java换成纯英文一类的不带特殊字符的路径即可。

比如我这里换成了

bash 复制代码
D:\Java\jvms_v2.1.5_amd64

之前用习惯了自己搭建的武器库,导致武器库的路径有大量的中文,只不过我没太想到的是这玩意调用Java的频率不低。没办法只能给Java换路径,导致我重构了武器库,裂开

相关推荐
丸码8 小时前
Java异常体系全解析
java·开发语言
v***88569 小时前
Springboot项目:使用MockMvc测试get和post接口(含单个和多个请求参数场景)
java·spring boot·后端
q***49459 小时前
Ubuntu介绍、与centos的区别、基于VMware安装Ubuntu Server 22.04、配置远程连接、安装jdk+Tomcat
java·ubuntu·centos
q***72199 小时前
PHP使用Redis实战实录2:Redis扩展方法和PHP连接Redis的多种方案
开发语言·redis·php
k***82519 小时前
python爬虫——爬取全年天气数据并做可视化分析
开发语言·爬虫·python
IMPYLH9 小时前
Lua 的 require 函数
java·开发语言·笔记·后端·junit·lua
曾经的三心草9 小时前
基于正倒排索引的Java文档搜索引擎1-实现索引模块-实现Parser类
java·开发语言·搜索引擎
new_dev9 小时前
Python网络爬虫从入门到实战
爬虫·python·媒体
q***01659 小时前
Python爬虫完整代码拿走不谢
开发语言·爬虫·python
vx_bscxy3229 小时前
告别毕设焦虑!Python 爬虫 + Java 系统 + 数据大屏,含详细开发文档 基于web的图书管理系统74010 (上万套实战教程,赠送源码)
java·前端·课程设计