I'm using BasicSR in my one of the desktop application. and It's working and running fine on PyCharm.
But after converting it to EXE file using pyinstaller, I'm getting below error.
I think it can be os.scandir, but how can I solve this, I don't know..
please help me to resolve this as I've already spent a lot time..
Traceback (most recent call last):
File "yogeshbhaiDesktop.py", line 7, in
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 546, in exec_module
File "basicsr_init.py", line 3, in
File "", line 991, in _find_and_load
File "", line 975, in find_and_load_unlocked
File "", line 671, in load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 546, in exec_module
File "basicsr\archs_init.py", line 14, in
File "basicsr\archs_init.py", line 14, in
File "basicsr\utils\misc.py", line 74, in _scandir
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\Users\gbd\AppData\Local\Temp\_MEI45162\basicsr\archs'
.spec file:
# -*- mode: python ; coding: utf-8 -*-
block_cipher = None
a = Analysis(['yogeshbhaiDesktop.py'],
pathex=['E:\\deployyPythonDesktop'],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=['hook-basicsr.py'],
hooksconfig={},
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='yogeshbhaiDesktop',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=False,
disable_windowed_traceback=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None )
hook-basicsr.py file
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files("basicsr", includes=["archs/*_arch.py"])
Thanks in advance..
I solved this problem by replacing the content of
basicsr/archs/__init__.pywith the following. And do the same operation for those who use scandir in__init__.py.