PyInstaller error when running exe with TensorFlow2 and Tkinter libraries

Neizvestnyj

I have a small application on Tkinter that uses the TensorFlow2 library. I'm running pyinstaller main2.py and the project is successfully built, but when you run it through the console, you get this:

C:\Users\pikro\PycharmProjects\NeuralStyleTransfer\dist\main2>main2.exe
2020-05-24 15:48:27.175935: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found
2020-05-24 15:48:27.180194: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
c:\users\pikro\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 "main2.py", line 2, 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 "c:\users\pikro\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\tensorflow\__init__.py", line 48, 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 "c:\users\pikro\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\tensorflow\_api\v2\compat\__init__.py", line 39, 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 "c:\users\pikro\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\tensorflow\_api\v2\compat\v1\__init__.py", line 34, 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 "c:\users\pikro\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\tensorflow\_api\v2\compat\v1\compat\__init__.py", line 39, 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 "c:\users\pikro\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\tensorflow\_api\v2\compat\v1\compat\v1\__init__.py", line 51, 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 "c:\users\pikro\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\tensorflow\_api\v2\compat\v1\lite\__init__.py", line 11, 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 "c:\users\pikro\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\tensorflow\_api\v2\compat\v1\lite\experimental\__init__.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 "c:\users\pikro\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\tensorflow\_api\v2\compat\v1\lite\experimental\nn\__init__.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 "c:\users\pikro\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\tensorflow\lite\python\lite.py", line 35, 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 "c:\users\pikro\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\tensorflow\lite\experimental\microfrontend\python\ops\audio_microfrontend_op.py", line 30, in <module>
  File "site-packages\tensorflow\python\framework\load_library.py", line 58, in load_op_library
tensorflow.python.framework.errors_impl.NotFoundError: C:\Users\pikro\PycharmProjects\NeuralStyleTransfer\dist\main2\tensorflow\lite\experimental\microfrontend\python\ops\_audio_microfrontend_op.so not found
[9892] Failed to execute script main2

How can I fix this error?

My imports:

from tkinter import *
import tensorflow as tf
import tensorflow_hub as hub
import numpy as np
import PIL.Image
Neizvestnyj

I create new conda env, install tensorflow v2.1.0, created a file hook-tensorflow.py and moved it to PyInstaller

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Error when using statsmodels with pyinstaller

Python executables: py2exe or PyInstaller?

Import error when running pyinstaller app

CMake project using Qt libraries in Visual Studio 2017: can't find Qt dll when running the exe

Runtime error when calling a .exe made with PyInstaller including PyQt4

Error after converting tkinter program to exe using cx_Freeze and running the exe file

Pyinstaller with pandas and numpy, exe throws error at runtime

PyInstaller exe returning error on a Tkinter script

error in running exe file having xgboost package by using pyinstaller

Exe with tkinter GUI generated by Pyinstaller exe does not work

Chromedriver Path Error when converting to .exe Pyinstaller

Python pyinstaller error when converting py to exe

Pyinstaller - Python exe when run shows error "Failed to execute script pyi_rth_nltk"

Pyinstaller: Module not found when running .exe

NameError: name 'defaultParams' is not defined while running the .exe converted using Pyinstaller

Error creating .exe (pyinstaller) with cloudscraper module [Python]

Pyinstaller Error when running the exe file

How do I include poppler to pyinstaller generated exe when using pdf2image?

crontab error running exe jar

Pyinstaller, .py version works, .exe "No module named Tkinter"?

cx_Freeze - Error when running .exe from desktop shortcut

ResourceExhausted Error or OOM when running LSTM in Tensorflow

PyInstaller exe gives cython error

Python to EXE generated through Pyinstaller not running for kivy based python

Error when compiling with pyinstaller with configparser

How to fix error with pyinstaller after compilation in exe

Error while loading shared libraries when running executable

Getting `error while loading shared libraries: libssl.so.1.1` when running docker container

PyInstaller: Error when executing .exe file from a python file with Sun-valley tkinter theme