gpt4 book ai didi

cx-freeze - 运行包抛出 ImportError : No module named image

转载 作者:行者123 更新时间:2023-12-04 12:48:37 24 4
gpt4 key购买 nike

使用 cx_freeze在 ubuntu 12.04 下。包的生成是
完成没有任何错误但是当我尝试将包作为
独立,我收到以下错误:

    Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/cx_Freeze/initscripts /Console.py",
line 27, in <module>
exec code in m.__dict__
m m File "Setup_cx_freeze.py", line 3, in <module>
File "/usr/local/lib/python2.7/dist-packages/cx_Freeze/__init__.py",
line 4, in <module>
from cx_Freeze.dist import *
File "/usr/local/lib/python2.7/dist-packages/cx_Freeze/dist.py",
line 3, in <module>
import distutils.command.install
File "/usr/lib/python2.7/distutils/command/install.py", line 21, in <module>
from site import USER_BASE
File "/usr/lib/python2.7/site.py", line 562, in <module>
main()
File "/usr/lib/python2.7/site.py", line 540, in main
abs__file__()
File "/usr/lib/python2.7/site.py", line 100, in abs__file__
m.__file__ = os.path.abspath(m.__file__)
File "/usr/lib/python2.7/email/__init__.py", line 79, in __getattr__
__import__(self.__name__)
ImportError: No module named image

我想重点是最后一句话。 "ImportError: No module named image."
该应用程序在纯python环境中运行没有任何问题
那么为什么在将它作为“卡住”包运行时会出现错误?这
生成卡住包时以某种方式引入了错误。

最佳答案

我最终通过在 setup.py 脚本构建 exe 选项中明确包含包“email.mime”来解决这个问题。

关于cx-freeze - 运行包抛出 ImportError : No module named image,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12615693/

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