【发布时间】:2020-06-01 08:25:09
【问题描述】:
如果我的 pyinstaller 创建的脚本依赖于存储在不同文件中的函数,我该如何运行它?
我有一个文件,让我们调用 file.py,其中有:
sys.path.insert(0, 'Functions')
from getDigits import getDigits
在我创建的 pyinstaller 可执行脚本中,它运行 file.py 和 file2.py 但只有 file.py 使用 import getDigits 函数。
My error code is: ModuleNotFoundError: No module named 'getDigits' 即使我将 getDigits 文件放在与可执行文件相同的目录中。
我是否需要使用完整路径或其他东西,如果需要,我该如何完成?
另外,另一个问题是如何将图标用于可执行文件:我使用了以下内容,但它仍然没有显示带有所需图标的可执行文件。我在同一目录中有一个 folder.ico。
pyinstaller --onefile --icon=folder.ico run_files.py
【问题讨论】:
标签: python pyinstaller