我已经使用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'我没有得到要进口的东西..。
我也尝试过添加
setup.py中的“请求”和“os”包。
但没有运气..。
发布于 2018-03-25 00:35:31
这应该只是将chardet添加到includes命令中的问题。
build_exe_options = {"includes":["chardet"]}请参阅build_exe选项。
发布于 2021-01-28 06:50:47
也有同样的问题。另一个解决方法是将版本降级为chardet==3.0.2。在将后续记录和元数据文件下载到chardet文件夹之前,我甚至无法做到这一点:
https://rabbit.test.polarvagnen.se/env/lib/python3.6/site-packages/chardet-3.0.4.dist-info/
https://stackoverflow.com/questions/49410132
复制相似问题