我正在尝试使用PyInstaller构建包含可执行文件device_detector
的可执行文件。
运行二进制文件时,出现错误:
File "device_detector/device_detector.py", line 233, in parse
File "device_detector/device_detector.py", line 312, in parse_bot
File "device_detector/parser/parser.py", line 87, in parse
File "device_detector/parser/parser.py", line 71, in _parse
File "device_detector/yaml_loader.py", line 81, in regex_list
File "device_detector/yaml_loader.py", line 63, in yaml_to_list
File "device_detector/yaml_loader.py", line 39, in load_from_yaml
File "~/pyenv/PyInstaller/loader/pyimod03_importers.py", line 462, in get_data
assert path.startswith(SYS_PREFIX + pyi_os_path.os_sep)
AssertionError
我认为这是因为device_detector
在运行时使用__load__
来读取.yml
个文件,请参见此行here。
我试图通过将丢失的.yml
文件添加到datas
中来添加这些文件,但这并没有解决问题。
我需要为device_detector
编写某种挂钩吗?我对下一步的工作感到迷茫,对您的帮助大加赞赏。
答案 0 :(得分:0)
我快速浏览了device_detector代码,我的理解是它正在加载local / device / normalize.yml。可以通过将其添加到您的构建命令中来进行管理
--add-data path_to_the_actual_normalize.yml\normalize.yml;local/device