Building one file eel python aplication with pyinstaller - python

After building distributable binary with PyInstaller
python.exe -m eel --onefile c:\Users\Darek\PycharmProjects\eelTest\web\ c:\Users\Darek\PycharmProjects\eelTest\eelTest.py
When I try run app I got this error
Failed to extract C:\Users\Darek\PycharmProjects\eelTest\web\main.html: failed to open target file!
fopen: Invalid argument
How to fix it?

Related

no module named cv2 pyinstaller

i made a python script(flask) that use html and generate a local host link to open my website i also imported some deep learning models to my project what i want is i want to make an exe file that gives me the output is the local host link so i used this command to make it
pyinstaller --onefile main.py
but when i run my exe file it gives me this error
no module named cv2
i also tried this command
pyinstaller spec_an_API.py --onefile --add-data "templates";"templates" --add-data "static";"static"
but same problem
not that my program has no errors i tried to run it from pycharm and it works well

Create exe file from script using Pyinstaller in Anaconda environment

I want to create exe file in Anaconda environment using Pyinstaller.
First, I have successfully installed Pyinstaller using this code:
conda install -c conda-forge pyinstaller
Then I also have converted my ipynb file to py file using "Download as".
Now, when I tried my py code using this code:
python Jumlah.py
I got his error:
File "<ipython-input-7-a5108a3cc2af>", line 1
python Jumlah.py
^
SyntaxError: invalid syntax
An when I run Pyinstaller using this code:
pyinstaller --onefile Jumlah.py
I got the same error:
File "<ipython-input-8-405d6dae7a75>", line 1
pyinstaller --onefile Jumlah.py
^
SyntaxError: invalid syntax
So, how can I fix this error?
Your problem is that after downloading the jupyter notebook as .py, your file.py contains lines like "get_ipython().run_line_magic('matplotlib', 'inline')".
You have to delete them first!

Q: Python script into ececutable NOT WORKING (pyinstaller / cx_Freeze)

I tried to convert a python script called table.py to .exe
The scripts imports openpyxl, pandas, dataframe_image
I've tried using the modules in the title as so:
pyinstaller: I ran: pyinstaller --onefile -windowed table.py . When I click the executable there's a popup message saying Failed to execute script table
cx_Freeze: I ran python setup.py build_exe
it printed error: The baseline image directory does not exist. This is most likely because the test data is not installed. You may need to install matplotlib from the source to get the test data.
so I followed the answer here and ran:
pip install "numpy<1.18.3" "pillow<7"
python setup.py build_exe --excludes=matplotlib.tests,numpy.random._examples
and It poped up this message:
Anyone got any ideas on how to proceed now?

PyInstaller created GTK3 executable: gi/_gi-cpython-38.dll could not be extracted

I tried to create GTK executable using PyInstaller on MSYS2 and it builds without any errors.
The command I used to create executable:
pyinstaller --onedir --onefile --name="MyStandalone" --windowed "app.py"
At the and I got:
14955 INFO: Building EXE from EXE-00.toc completed successfully.
When I try to run created file, I get the error below:
Fatal error detected
gi/_gi-cpython-38.dll could not be extracted
fopen: No such file or directory
How to avoid that error? Thanks.

how to solve fbs error 'Can not find path ./libshiboken2.abi3.5.13.dylib'?

I have been able to freeze a Python/PySide2 script with fbs on macOS, and the app seems to work.
However, I got some errors from the freeze process stating:
Can not find path ./libshiboken2.abi3.5.13.dylib.
Does anyone know how to fix that?
Try to use the --runtime-tmpdir because while running the generated exe file it needs this file libshiboken2.abi3.5.13.dylib and unable hook that file.
Solution: use --add-data & --runtime-tmpdir to pyinstaller command line.
pyinstaller -F --add-data "path/libshiboken2.abi3.5.13.dylib":"**PATH"
--runtime-tmpdir temp_dir_name your_program.py
here PATH = the directory name of that file looking for.-F = one file

Categories

Resources