gpt4 book ai didi

python - 没有名为 'chardet' 的模块

转载 作者:行者123 更新时间:2023-12-05 07:35:39 24 4
gpt4 key购买 nike

我已经使用 cx_Freeze 创建了一个 exe。
构建成功。
然后当我点击 exe 时,我得到:-

no module named 'queue'

所以,我研究并添加了这一行:-

from multiprocessing import Queue

现在我得到:-

no module named 'chardet'. 

这是我得到的完整错误:-

Traceback (most recent call last):
File "C:\Users\pc\AppData\Local\Programs\Python\Python36-32\lib\site-pac
kages\cx_Freeze\initscripts\__startup__.py", line 14, in run
module.run()
File "C:\Users\pc\AppData\Local\Programs\Python\Python36-32\lib\site-pac
kages\cx_Freeze\initscripts\Console.py", line 26, in run
exec(code, m.__dict__)
File "normalapi_2103.py", line 1, in <module>
File "C:\Users\pc\AppData\Local\Programs\Python\Python36-32\lib\site-pac
kages\requests-2.18.4-py3.6.egg\requests\__init__.py", line 44, in <module>
import chardet
ModuleNotFoundError: No module named 'chardet'

而且我没有得到要导入的内容...

我也试过添加

'requests' and 'os' packages in setup.py.

但是没有运气......

最佳答案

这应该只是将chardet添加到includes命令的问题。

build_exe_options = {"includes":["chardet"]}

参见 build_exe选项。

关于python - 没有名为 'chardet' 的模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49410132/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com