cx_Freeze - pkg_resources.DistributionNotFound:'pycountry'

问题描述

我正在尝试使用 cx_Freeze 和 setup.py 中的以下配置从 Python 脚本制作可执行文件

from cx_Freeze import setup,Executable
import sys
import os
import tkinter

base = None

if sys.platform == 'win32':
    base = "win32gui"

executables = [Executable("faktury.py",base=base)]

packages = ["idna","scripts.variables_windows","scripts.variables_mac","random","string","pickle","subprocess","os","scripts.variables_all_platforms","scripts.customer_win","scripts.main_win","tkinter"]
options = {
    'build_exe': {
        'includes': packages,'include_files': [r"C:\Program Files\python39\DLLs\tcl86t.dll",r"C:\Program Files\python39\DLLs\tk86t.dll"]
    },}

os.environ['TCL_LIBRARY'] = r'C:\Program Files\python39\tcl\tcl8.6'
os.environ['TK_LIBRARY'] = r'C:\Program Files\python39\tcl\tk8.6'


setup(
    name="faktury",version="1.0",description="desc",options=options,executables=executables
)

scripts. 包是我导入到 faktury.py 的其他相关脚本)

但是当我运行 build 文件夹中的 .exe 文件时,出现此错误

pkg_resources.DistributionNotFound: The 'pycountry' error message

顺便说一句,pycountry输出目录的 lib 文件夹中存在(并且不是空的),我无法找出问题所在。

任何解决方法的想法将不胜感激,谢谢!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)