我正在尝试使用 pyinstaller 将 dask 数据帧用于打包的可执行文件。
我刚刚
导入数据
在我的可执行文件中,我用
打包它pyinstaller scripts.py
当我运行它时,我发现找不到 /some/path/dask.yaml
。
有人知道我是否应该添加隐藏的导入或者如何解决这个问题吗?
最佳答案
要在 PyInstaller 中使用 dask
,您需要使用 add-data
将 dask.yaml
和 distributed.yaml
添加到您的输出可执行文件中标志:
pyinstaller -F --add-data "<python_path>/Lib/site-packages/dask/dask.yaml;./dask" --add-data "<python_path>/Lib/site-packages/distributed/distributed.yaml;./distributed" script.py
关于python - Dask + pyinstaller 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57057336/