I was trying to make a .py to .exe file using pyinstaller. After building the exe file, when I tried to run the .exe file through cmd, then it shows this error bellow.
D:\Ne folder\New folder\GuiExe>GuiExe.exe
Using TensorFlow backend.
Traceback (most recent call last):
File "GuiExe.py", line 4, in <module>
File "c:\users\manash\tesorflow\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
exec(bytecode, module.__dict__)
File "lib\site-packages\keras\__init__.py", line 3, in <module>
File "c:\users\manash\tesorflow\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
exec(bytecode, module.__dict__)
File "lib\site-packages\keras\utils\__init__.py", line 6, in <module>
File "c:\users\manash\tesorflow\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
exec(bytecode, module.__dict__)
File "lib\site-packages\keras\utils\conv_utils.py", line 9, in <module>
File "c:\users\manash\tesorflow\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
exec(bytecode, module.__dict__)
File "lib\site-packages\keras\backend\__init__.py", line 1, in <module>
File "c:\users\manash\tesorflow\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
exec(bytecode, module.__dict__)
File "lib\site-packages\keras\backend\load_backend.py", line 90, in <module>
File "c:\users\manash\tesorflow\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
exec(bytecode, module.__dict__)
File "lib\site-packages\keras\backend\tensorflow_backend.py", line 5, in <module>
File "c:\users\manash\tesorflow\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
exec(bytecode, module.__dict__)
File "lib\site-packages\tensorflow\__init__.py", line 101, in <module>
File "c:\users\manash\tesorflow\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
exec(bytecode, module.__dict__)
File "lib\site-packages\tensorflow_core\__init__.py", line 40, in <module>
File "lib\site-packages\tensorflow\__init__.py", line 50, in __getattr__
File "lib\site-packages\tensorflow\__init__.py", line 44, in _load
File "importlib\__init__.py", line 126, in import_module
File "c:\users\manash\tesorflow\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
exec(bytecode, module.__dict__)
File "lib\site-packages\tensorflow_core\python\__init__.py", line 49, in <module>
ImportError: cannot import name 'pywrap_tensorflow'
[1764] Failed to execute script GuiExe
P.s. I also tied --hidden-import pywrap_tensorflow and --paths where pywrap_tensorflow.py file situated.
My PY to EXE command was
pyinstaller --paths C:/Users/Manash/tesorflow/Lib/site-packages/tensorboard/compat/tensorflow_stub/pywrap_tensorflow.py --hidden-import pkg_resources.py2_warn --hidden-import pywrap_tensorflow --add-data "C:/Ne folder/train_with_vali_test_model_6_111(GLOVES)_soreo-ou_test.pckle";. GuiExe.py
My python version# 3.5.4 Tensorflow version# 2.1.0 keras version# 2.3.1
Please, help me, and tell me should I give more information, or Which ones information should I provide. To get a solution. Thanks in advance.