I am working on a project which involves doing a language check for an input. When we try to turn it into a .exe file using PyInstaller, it gives away this errors:
C:\Users\luismanj\Allegations_TEF_ARG\dist>.\allegations.exe
Traceback (most recent call last):
File "allegations.py", line 16, in <module>
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "C:\Users\luismanj\Anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
exec(bytecode, module.__dict__)
File "language_check.py", line 1, in <module>
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "C:\Users\luismanj\Anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
exec(bytecode, module.__dict__)
File "langdetect\__init__.py", line 1, in <module>
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "C:\Users\luismanj\Anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
exec(bytecode, module.__dict__)
File "langdetect\detector_factory.py", line 10, in <module>
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "C:\Users\luismanj\Anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
exec(bytecode, module.__dict__)
File "langdetect\detector.py", line 9, in <module>
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "C:\Users\luismanj\Anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
exec(bytecode, module.__dict__)
File "langdetect\utils\ngram.py", line 23, in <module>
File "langdetect\utils\ngram.py", line 24, in NGram
File "langdetect\utils\messages.py", line 22, in get_string
File "langdetect\utils\messages.py", line 9, in __init__
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\luismanj\\AppData\\Local\\Temp\\_MEI118322\\langdetect\\utils\\messages.properties'
[22436] Failed to execute script allegations
It seems the main problem as of now is the library Langdetect, which we have been using without issues until now. If anyone knows the cause or has found a workaround for this problem, any comment will be appreciated. Thank you.
Related
I converted my .py file which contains the alive progress bar package https://pypi.org/project/alive-progress/ into a .exe for windows using the pyinstaller command pyinstaller --console . I however receive an error when I run the program. It runs fine until the alive bar is called and then it prints out the error below.
Traceback (most recent call last):
File "network_nodes_ping.py", line 38, in <module>
File "alive_progress\core\progress.py", line 106, in alive_bar
File "alive_progress\core\configuration.py", line 149, in create_context
File "alive_progress\core\configuration.py", line 183, in lazy_init
File "alive_progress\core\configuration.py", line 14, in _spinner_input_factory
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "alive_progress\styles\__init__.py", line 1, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "alive_progress\styles\exhibit.py", line 9, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "alive_progress\styles\internal.py", line 126, in <module>
File "alive_progress\styles\internal.py", line 12, in create_spinners
File "alive_progress\animations\spinners.py", line 43, in frame_spinner_factory
File "alive_progress\animations\spinners.py", line 43, in <genexpr>
File "alive_progress\animations\spinners.py", line 43, in <genexpr>
File "alive_progress\utils\cells.py", line 145, in to_cells
File "alive_progress\utils\cells.py", line 149, in split_graphemes
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "grapheme\__init.py", line 9, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "grapheme\api.py", line 2, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "grapheme\finder.py", line 3, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "grapheme\grapheme_property_group.py", line 97, in <module>
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\BRYANV~1\\AppData\\Local\\Temp\\_MEI85082\\grapheme\\data/grapheme_break_property.json'
[13328] Failed to execute script 'network_nodes_ping' due to unhandled exception!
A shorter alternative to what #Pluckerpluck has suggested would be using --collect-data grapheme instead of --add-data <...>.
alive-progress uses a library called grapheme. This library requires a JSON file which you will have to manually specify when using PyInstaller.
In my case, I had it under .venv so the command to make this work was:
pyinstaller -F --add-data ".\.venv\Lib\site-packages\grapheme\data\grapheme_break_property.json;grapheme\data" my_file.py
Note that the argument --add-data takes both a source and a target directory (which we set to grapheme\data)
I will warn you however, that the default terminal doesn't have the fonts capable of actually displaying the progress bar. It works, but it doesn't look pretty. If you run the .exe from a proper terminal though with the font support, it works just fine after this.
I'm trying to compile my code that used tensorflow. I've been working with Tensorflow 1.15 although it is compatible with (1.14 and 1.13). Previously had never had issues with pyinstaller but after creating a new conda environment I stopped being able to compile the same code.
To me, it seems like tensorflow and pyinstaller don't play with each other well. I tried a few version combinations and still no luck. I get this error during import tensorlfow statement after compilation. The program runs fine in python 3.7 or python 3.6.
Traceback (most recent call last):
File "my_dir\mv_app.py", line 39, in <module>
from shot_change_detection import shot_change_detection
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 623, in exec_module
File "shot_change_detection\shot_change_detection.py", line 42, in <module>
import tensorflow as tf
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 623, in exec_module
File "tensorflow\__init__.py", line 99, 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 623, in exec_module
File "tensorflow_core\__init__.py", line 28, in <module>
File "<frozen importlib._bootstrap>", line 1019, in _handle_fromlist
File "tensorflow\__init__.py", line 50, in __getattr__
File "tensorflow\__init__.py", line 44, in _load
File "importlib\__init__.py", line 127, in import_module
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
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 623, in exec_module
File "tensorflow_core\python\__init__.py", line 52, 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 623, in exec_module
File "tensorflow_core\core\framework\graph_pb2.py", line 7, 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 623, in exec_module
ValueError: source code string cannot contain null bytes
This Is Error Which I Got in Cmd i Used pyrogram which is telegram client library
Traceback (most recent call last):
File "pyroses.py", line 1, in <module>
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "c:\python38\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\pyrogram\client\client.py", line 39, in <module>
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "c:\python38\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\pyrogram\client\methods\__init__.py", line 19, in <module>
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "c:\python38\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\pyrogram\client\methods\bots\__init__.py", line 19, in <module>
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "c:\python38\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\pyrogram\client\ext\__init__.py", line 19, in <module>
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "c:\python38\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\pyrogram\client\ext\base_client.py", line 32, in <module>
File "site-packages\pyrogram\client\ext\base_client.py", line 80, in BaseClient
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\DarkWeb\\AppData\\Local\\Temp\\_MEI113122\\pyrogram\\client\\ext/mime.types'
[14764] Failed to execute script pyroses
just i used pyrogram library and used client.get_me()
my code
import pyrogram
client = pyrogram.Client(
session_name,
api_id=****,
api_hash="****"
).start()
print(client.get())
i converted it into exe using pyinstaller -F -i icon.ico pyroses.py and it showed me this
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
I create new conda env, install tensorflow v2.1.0, created a file hook-tensorflow.py and moved it to PyInstaller
Problem occuring in this line :
from keras import backend as K
I am converting a python source code which uses tensorflow and keras API for testing data.
Using pyinstaller to convert it into exe in Windows OS. I am getting below error related to astor file version. I don't know why i am getting this error after executing the exe file. I am getting no error while running the source code as python filename.py
Using
Python 3.7
tensorflow==1.15
keras==2.0.3
from keras import backend as K is written in exterior file which is imported to main file.
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:\program files\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\keras\__init__.py", line 3, 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:\program files\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\keras\activations.py", line 3, 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:\program files\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\keras\backend\__init__.py", line 73, 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:\program files\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\keras\backend\tensorflow_backend.py", line 1, 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:\program files\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\tensorflow\__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 "c:\program files\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\tensorflow\python\__init__.py", line 73, 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:\program files\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\tensorflow\python\ops\standard_ops.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 "c:\program files\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\tensorflow\python\autograph\__init__.py", line 37, 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:\program files\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\tensorflow\python\autograph\core\converter.py", line 71, 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:\program files\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\tensorflow\python\autograph\pyct\cfg.py", line 41, 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:\program files\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\tensorflow\python\autograph\pyct\compiler.py", line 32, 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:\program files\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\astor\__init__.py", line 24, in <module>
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\{Username}\\AppData\\Local\\Temp\\_MEI98802\\astor\\VERSION'
[8240] Failed to execute script test_exec
You could try to downgrade astor to 0.7.1 and pyinstaller to 3.5
I faced the same problem. My astor package version was 0.8.1. I changed astor version to 0.7.1. It worked for me. pyinstaller version 3.6