I have been trying to build an executable from a python script with pyinstaller, but, once I run it with
pyinstaller --onefile stock_visual.py
in the windows cmd, and generates the files, whenever I run it, I get the following error:
Traceback (most recent call last):
File "stock_visual.py", line 6, 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\verdi\github\jiostocks\venv\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
exec(bytecode, module.__dict__)
File "lib\site-packages\dash_core_components\__init__.py", line 12, in <module>
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Verdi\\AppData\\Local\\Temp\\_MEI112322\\dash_core_components\\package-info.json'
[4824] Failed to execute script stock_visual
Now, I have seen several people encountering a similar problem, but they were due to the need of importing manually a dynamically imported library like explained in the pyinstaller documentation here:
https://pythonhosted.org/PyInstaller/when-things-go-wrong.html#listing-hidden-imports
This did not seem to work in my case, and the directory it is looking for the dash_core_components files is not even created:
As a side note, if i do not use the --onefile option, the same problem occurs but the folder is INSIDE the project, in the \build folder, but the directory the program looks for the library does not exist either.
By now, I have tried the --onedir option, including the libraries manually as I said before, everything said in the pyinstaller troubleshooting web page basically and the py2exe and cx freezer alternatives, which also gave their own errors.
The script I am trying to use the builder with can be found in this repo and I have tried it with other scripts and runs without any problem.
I am using windows10 64 bits, with python3.8 and a closed virtual environment (venv) with all the libraries listed in the requirements.txt file contained in said repository.
Any hint of how could I fix this problem would be very much appreciated.