我的Python脚本在一个有python 3.9.2的虚拟环境中执行得很好,但是当我使用pyinstaller创建一个exe时,exe不能工作,我会得到某些模块的跟踪,但是当我在spec文件的帮助下添加缺少的模块时,它会给出其他一些缺少的模块的跟踪。
File “modin\config\pubsub.py”, line 118, in get
File “modin\config\envvars.py”, line 32, in _get_raw_from_config
File “os.py”, line 669, in getitem
KeyError: ‘MODIN_ENGINE’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “file.py”, line 1
118, in
File “file.py”, line 8
38, in commonsteps
File “swifter\swifter.py”, line 358, in apply
File “swifter\swifter.py”, line 259, in _modin_apply
File “”, line 961, in _find_and_load
File “”, line 950, in find_and_load_unlocked
File “”, line 655, in load_unlocked
File “PyInstaller\loader\pyimod03_importers.py”, line 476, in exec_module
File "modin\pandas_init.py", line 180, in
File “modin\config\pubsub.py”, line 107, in subscribe
File "modin\pandas_init.py", line 109, in _update_engine
File “modin\config\pubsub.py”, line 120, in get
File “modin\config\envvars.py”, line 75, in _get_default
File “”, line 961, in _find_and_load
File “”, line 950, in _find_and_load_unlocked
File “”, line 655, in load_unlocked
File “PyInstaller\loader\pyimod03_importers.py”, line 476, in exec_module
File "distributed_init.py", line 1, in
File “”, line 961, in _find_and_load
File “”, line 950, in _find_and_load_unlocked
File “”, line 655, in _load_unlocked
File “PyInstaller\loader\pyimod03_importers.py”, line 476, in exec_module
File “distributed\config.py”, line 17, in
FileNotFoundError: [Errno 2] No such file or directory: 'D:\01_xew\02_ret在得到这个回溯之后,我尝试在脚本中指定modin引擎,但是得到了这个回溯
Traceback (most recent call last):
File "swifter\swifter.py", line 340, in apply
File "DTC_dask.py", line 840, in compare
File "pandas\core\ops\common.py", line 65, in new_method
File "pandas\core\ops\__init__.py", line 365, in wrapper
ValueError: Can only compare identically-labeled Series objects
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "DTC_dask.py", line 1127, in <module>
File "DTC_dask.py", line 847, in commonsteps
File "swifter\swifter.py", line 358, in apply
File "swifter\swifter.py", line 259, in _modin_apply
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 476, in exec_module
File "modin\pandas\__init__.py", line 180, in <module>
File "modin\config\pubsub.py", line 107, in subscribe
File "modin\pandas\__init__.py", line 122, in _update_engine
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 476, in exec_module
File "distributed\__init__.py", line 1, in <module>
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 476, in exec_module
File "distributed\config.py", line 17, in <module>
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\TTC01017\\Documents\\My Received Files\\exe_392_dask\\distributed\\distributed.yaml'
[16400] Failed to execute script 'DTC_dask' due to unhandled exception!在此之后,当我尝试使用spec文件将缺失的目录添加到exe时,它将进一步给出其他缺少的模块的跟踪。
我想这里的主要问题是pyinstaller没有正确地处理与exe相关的库.有谁能帮助解决这个问题,以及如何用spec文件创建pyinstaller,该文件负责处理所有依赖库。
发布于 2021-11-23 12:35:40
在这两种情况下,都会引发FileNotFoundError,再次检查文件路径是否正确,如果是正确的,请尝试使用/而不是\\。
'C:/Users/TTC01017/Documents/My Received Files/exe_392_dask/distributed/distributed.yaml'https://stackoverflow.com/questions/70081000
复制相似问题