File "<frozen importlib.bootstrap>"line1027,in _find and loadFile "<frozenimportlib._bootstrap>"line 1006,in find_and load unlockedFile"<frozenimportlib. bootstrap>"line 688,in load unlockedFile"PyInstaller/loader/pyimod02_importers.py"line 419,in exec moduleFile"paddle/in <module>init.Py"line 28,importlib.in find and loadFile "<frozenbootstrap>Line 1027File "<frozenimportlib.linein find and load unlockedbootstrap>1006.File"<frozenimportlibbootstrap>line 688,in load unlockedFile"PyInstaller/loader/pyimod02 importers.py",line 419,in exec_moduleFile,line 36,in <module>"paddle/base/init-Py"File"<frozen importlib. bootstrap>"line 1027,in find and loadFile"<frozenimportlib._bootstrap>"line 1006,in find and load unlockedFile"<frozen importlib._bootstrap>"line 688,inload unlockedFile "PyInstaller/loader/pyimod02_importers.py",line 419,in exec_moduleFile "paddle/base/core.py"line 418,in <module>File"paddle/base/core.py"line 410,in set paddle lib path
Exception: sequence item 0: expected str instance, NoneType found
修改办法
https://github.com/PaddlePaddle/Paddle/issues/35058
https://github.com/PaddlePaddle/Paddle/issues/62128
编辑python包paddle/base/core.py
修改
else [x for x in sys.path if 'site-packages' in x]
为
else [x for x in sys.path if 'site-packages' in x and x is not None]
修改
if hasattr(site, 'USER_SITE')
为
if hasattr(site, 'USER_SITE') and site.USER_SITE: