current position:Home>When Python is packaged into exe, an error is reported when opening assertionerror: C: \ users \ Acer \ appdata \ local \ temp\_ MEI105682\distutils\core. pyc

When Python is packaged into exe, an error is reported when opening assertionerror: C: \ users \ Acer \ appdata \ local \ temp\_ MEI105682\distutils\core. pyc

2022-05-15 04:47:12CSDN Q & A

The phenomenon and background of the problem

Recently trained a model , Wrote an interface , stay pycharm No problem in operation , But this error occurs after packaging and running , Please, everybody

img

Operation results and error reporting contents

img

img

The detailed error reporting contents are as follows :

Traceback (most recent call last):  File "frame.py", line 10, in <module>  File "<frozen importlib._bootstrap>", line 983, in _find_and_load  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked  File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module  File "paddlex\__init__.py", line 17, in <module>  File "<frozen importlib._bootstrap>", line 983, in _find_and_load  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked  File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module  File "paddlex\utils\__init__.py", line 15, in <module>  File "<frozen importlib._bootstrap>", line 983, in _find_and_load  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked  File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module  File "paddlex\utils\logging.py", line 21, in <module>  File "<frozen importlib._bootstrap>", line 983, in _find_and_load  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked  File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module  File "paddle\__init__.py", line 25, in <module>  File "<frozen importlib._bootstrap>", line 983, in _find_and_load  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked  File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module  File "paddle\framework\__init__.py", line 17, in <module>  File "<frozen importlib._bootstrap>", line 983, in _find_and_load  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked  File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module  File "paddle\framework\random.py", line 16, in <module>  File "<frozen importlib._bootstrap>", line 983, in _find_and_load  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked  File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module  File "paddle\fluid\__init__.py", line 45, in <module>  File "<frozen importlib._bootstrap>", line 983, in _find_and_load  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked  File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module  File "paddle\fluid\dataset.py", line 19, in <module>  File "<frozen importlib._bootstrap>", line 983, in _find_and_load  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked  File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module  File "paddle\utils\__init__.py", line 28, in <module>  File "<frozen importlib._bootstrap>", line 983, in _find_and_load  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked  File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module  File "paddle\utils\cpp_extension\__init__.py", line 15, in <module>  File "<frozen importlib._bootstrap>", line 983, in _find_and_load  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked  File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module  File "paddle\utils\cpp_extension\cpp_extension.py", line 20, in <module>  File "<frozen importlib._bootstrap>", line 983, in _find_and_load  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked  File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module  File "setuptools\__init__.py", line 8, in <module>  File "<frozen importlib._bootstrap>", line 983, in _find_and_load  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked  File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module  File "_distutils_hack\override.py", line 1, in <module>  File "_distutils_hack\__init__.py", line 73, in do_override  File "_distutils_hack\__init__.py", line 61, in ensure_local_distutilsAssertionError: C:\Users\Acer\AppData\Local\Temp\_MEI105682\distutils\core.pyc
My solution ideas and tried methods

No problem with anything else , Just introduce paddlex Then this error occurred ,
Comment out about paddlex The code can then be packaged and run properly

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.pythonmana.com/2022/131/202205041653539348.html

Random recommended