我在将 python 文件转换为 exe 时遇到问题

问题描述 投票:0回答:2

当我单击程序运行它时,我看到消息:Traceback(最近一次调用最后一次):

  File "employee manager.py", line 388, in <module>
  File "tkcalendar\dateentry.py", line 128, in __init__
  File "tkcalendar\calendar_.py", line 258, in __init__
  File "babel\dates.py", line 351, in get_day_names
  File "babel\core.py", line 652, in days
  File "babel\core.py", line 363, in _data
  File "babel\localedata.py", line 140, in load
  File "babel\localedata.py", line 146, in load
ModuleNotFoundError: No module named 'babel.numbers'

我需要打开程序

python windows cmd exe converters
2个回答
2
投票

A:很可能需要更多信息来解决这个问题

此外,它还说:ModuleNotFoundError:没有名为“babel.numbers”的模块 “numbers”是 babel 的订阅。如果您想订阅号码,请尝试执行以下操作:

from babel import numbers

祝你好运!有需要的我会尽力对应!


0
投票

我假设您正在使用 PyInstaller。 tkcalendar 的 github 页面上有一个关于此问题的 问题 ,以及解决此问题的 评论

pyinstaller.exe --hidden-import babel.numbers script.py

我遇到了同样的问题,这对我有用。

© www.soinside.com 2019 - 2024. All rights reserved.