0
votes

When i run the .exe, it occurred the error. Does anybody know how to fix it?

Failed to execute script prediction d:\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py:489: MatplotlibDeprecationWarning: The MATPLOTLIBDATA environment variable was deprecated in Matplotlib 3.1 and will be removed in 3.3. exec(bytecode, module.dict)

Traceback (most recent call last): File "ggcnn1\prediction.py", line 3, in

File "", line 983, in _find_and_load

File "", line 967, in _find_and_load_unlocked

File "", line 677, in _load_unlocked

File "d:\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module exec(bytecode, module.dict)

File "ggcnn1\func.py", line 4, in

File "", line 983, in _find_and_load

File "", line 967, in _find_and_load_unlocked

File "", line 677, in _load_unlocked

File "d:\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module exec(bytecode, module.dict)

File "ggcnn1\grasp1.py", line 5, in

File "", line 983, in _find_and_load

File "", line 967, in _find_and_load_unlocked

File "", line 677, in _load_unlocked

File "d:\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module exec(bytecode, module.dict)

File "site-packages\skimage__init__.py", line 127, in

File "", line 983, in _find_and_load

File "", line 967, in _find_and_load_unlocked

File "", line 677, in _load_unlocked

File "d:\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module exec(bytecode, module.dict)

File "site-packages\skimage\util__init__.py", line 6, in

File "", line 983, in _find_and_load

File "", line 967, in _find_and_load_unlocked

File "", line 677, in _load_unlocked

File "d:\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module exec(bytecode, module.dict)

File "site-packages\skimage\util\apply_parallel.py", line 8, in

File "", line 983, in _find_and_load

File "", line 967, in _find_and_load_unlocked

File "", line 677, in _load_unlocked

File "d:\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module exec(bytecode, module.dict)

File "site-packages\dask__init__.py", line 1, in

File "", line 983, in _find_and_load

File "", line 967, in _find_and_load_unlocked

File "", line 677, in _load_unlocked

File "d:\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module exec(bytecode, module.dict)

File "site-packages\dask\config.py", line 532, in

FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\YKCHEN~1\AppData\Local\Temp\_MEI165282\dask\dask.yaml'

1

1 Answers

0
votes

Here is a solution worked for me:

Create a hooks directory:

mkdir hooks

Create hook-dask.py file in ./hooks directory with the following codes:

from PyInstaller.utils.hooks import collect_submodules, collect_data_files

hiddenimports = collect_submodules('dask')
datas = collect_data_files('dask', subdir=None, include_py_files=True)

Create hook-dask-core.py file in ./hooks directory with the following codes:

from PyInstaller.utils.hooks import collect_submodules, collect_data_files

hiddenimports = collect_submodules('dask-core')
datas = collect_data_files('dask-core', subdir=None, include_py_files=True)

Run pyinstaller via:

pyinstaller -F --noupx --log-level=WARN --additional-hooks-dir=hooks --onefile main.py