Sco*_*tEU 4 python pyinstaller
我创建了一个 python 脚本,并使用以下命令将其转换为 .exe 文件:
\n\nPyinstaller \xe2\x80\x93-onefile RFOutputGraphs.py\nRun Code Online (Sandbox Code Playgroud)\n\n它可以工作,但是脚本中的一项作业失败了,尽管它在从 Python 运行时工作得很好。
\n\n我的错误是:
\n\n FileNotFoundError: [Errno 2] no such file or directory:\n 'C:\\\\Users\\\\Nicholas\\\\AppData\\\\Local\\\\Temp\\\\_MEI30362\\\\currency_converter\n \\\\eurofxref-hist.zip'\nRun Code Online (Sandbox Code Playgroud)\n\n我猜它没有识别出什么可能是不寻常的模块(currencyconverter)
\n\n有办法解决这个问题吗?
\n\n谢谢
\nPyinstaller您可以将 zip 文件包含在使用以下选项创建的 .exe 中--add-binary:
Pyinstaller --add-binary <path to zip>;currency_converter --onefile RFOutputGraphs.py
Run Code Online (Sandbox Code Playgroud)
currency_converter这会将 zip 文件从 PC 上的位置复制到 .exe 文件中,并在 .exe 运行时将其解压到文件夹(错误消息中提到的位置)中。看看使用 Pyinstaller。
| 归档时间: |
|
| 查看次数: |
8419 次 |
| 最近记录: |