【发布时间】:2018-05-04 21:14:22
【问题描述】:
我创建了一个 python 脚本并使用以下方法将其转换为 .exe 文件:
Pyinstaller –-onefile RFOutputGraphs.py
它可以工作,但是脚本中的一项作业失败了,尽管它在从 Python 运行时运行良好。
我的错误是:
FileNotFoundError: [Errno 2] no such file or directory:
'C:\\Users\\Nicholas\\AppData\\Local\\Temp\\_MEI30362\\currency_converter
\\eurofxref-hist.zip'
我猜它没有识别出可能是一个不寻常的模块(货币转换器)
有没有办法解决这个问题?
谢谢
【问题讨论】:
-
尝试使用
--add-binary选项。类似Pyinstaller --add-binary <path to zip>;currency_converter --onefile RFOutputGraphs.py -
感谢您的回复。我试过: Pyinstaller --add-binary ;currency_converter --onefile RFOutputGraphs.py ....它说它找不到指定的路径。我看了看,它不在那里。嗯
-
实际上不包括“”。您需要找到该 zip 文件的实际位置。错误消息中的路径是 Pyinstaller 期望找到它的位置,但它不存在。这就是你得到错误的原因。添加该选项会将 zip 文件从其实际位置(您必须在选项中指定)复制到 Pyinstaller 期望找到它的位置。
-
嘿,今天早上又开始工作了,效果很好。谢谢你。如果您想让您的评论成为答案,我会将其标记为已接受:)
标签: python pyinstaller