Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] 由于aiohttp的cchardet库不再维护,pyinstaller打包的时候没有正确地处理这种备用导入 #486

Open
Johnserf-Seed opened this issue Aug 4, 2023 · 3 comments
Assignees
Labels
故障(bug) 代码问题导致的错误(Bugs caused by code problems) 额外求助(help wanted) 非项目代码错误的求助(Extra attention is needed) 无效(invalid) 非代码故障导致错误或异常(Non-code faults causing errors or anomalies)

Comments

@Johnserf-Seed
Copy link
Owner

Johnserf-Seed commented Aug 4, 2023

描述出现的错误
aiohttp 在尝试导入 cchardet 和 charset_normalizer.md__mypyc,但是在打包的环境中并未找到它们。其中,cchardet 是py2版本的库,已经不再维护。 aio-libs/aiohttp#6862 于是打包的时候由于无法正确处理这些依赖关系导致无法运行打包的版本。

bug复现
复现这次行为的步骤:
pyinstaller -F -i logo.ico --version-file API\TikTokTool.txt TikTokTool.py

截图
image

桌面(请填写以下信息):
-操作系统:windows10 64bit
-vpn代理:关闭
-版本:1.4.0.0
-py版本:3.11.1

@Johnserf-Seed Johnserf-Seed added 故障(bug) 代码问题导致的错误(Bugs caused by code problems) 额外求助(help wanted) 非项目代码错误的求助(Extra attention is needed) 无效(invalid) 非代码故障导致错误或异常(Non-code faults causing errors or anomalies) labels Aug 4, 2023
@Johnserf-Seed Johnserf-Seed self-assigned this Aug 4, 2023
@Johnserf-Seed
Copy link
Owner Author

pyinstaller -F -i logo.ico --version-file API\TikTokTool.txt --hidden-import=charset_normalizer.md__mypyc TikTokTool.py
使用这条命令即可成功打包

@EsperantoP
Copy link

pyinstaller -F -i logo.ico --version-file API\TikTokTool.txt --hidden-import=charset_normalizer.md__mypyc TikTokTool.py 使用这条命令即可成功打包

非常及时的问题处理。爱来自UK

@EsperantoP
Copy link

EsperantoP commented Aug 4, 2023

pyinstaller -F -i logo.ico --version-file API\TikTokTool.txt --hidden-import=charset_normalizer.md__mypyc TikTokTool.py 使用这条命令即可成功打包

我是用了这个指令才能成功运行:

pyinstaller -F -i logo.ico --version-file API删掉我\删掉我\删掉我TikTokTool.txt --hidden-import=charset_normalizer.md__mypyc TikTokTool.py

那个“API”的后面应该有两个”\“的,才能在我的控制台里面运行。
@Johnserf-Seed的代码可能是因为GitHub给错误性地识别了导致两个”\“不见了。。
如果你也出现了@Johnserf-Seed发布的代码不能运行,请试试这个。

实现方法:把”删掉我“这三个字从那行代码中删掉再在控制台中复制并运行即可

Johnserf-Seed added a commit that referenced this issue Aug 5, 2023
添加--hidden-import=charset_normalizer.md__mypyc即可
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
故障(bug) 代码问题导致的错误(Bugs caused by code problems) 额外求助(help wanted) 非项目代码错误的求助(Extra attention is needed) 无效(invalid) 非代码故障导致错误或异常(Non-code faults causing errors or anomalies)
Projects
None yet
Development

No branches or pull requests

2 participants