How to add static(html, css, js, etc) files in pyinstaller to create standalone exe file?

From your question you can presume that the structure of your project is as follows: ├── index.html ├── jquery.js ├── main.py ├── my_custom.js └── styles.css For your case there are 2 options: using –add-data import os import sys from PyQt5 import QtCore, QtWidgets, QtWebEngineWidgets def resource_path(relative_path): “”” Get absolute path to resource, works for dev … Read more

No module named ‘pandas._libs.tslibs.timedeltas’ in PyInstaller

PyInstaller 3.3, Pandas 0.21.0, Python 3.6.1. I was able to solve this thanks to not-yet published/committed fix to PyInstaller, see this and this. AND keeping the ability to pack it into one executable file. Basically: Locate PyInstaller folder..\hooks, e.g. C:\Program Files\Python\Lib\site-packages\PyInstaller\hooks. Create file hook-pandas.py with contents (or anything similar based on your error): hiddenimports = … Read more

Pyinstaller and –onefile: How to include an image in the exe file

Edit: I belive I found the solution to my problem. # -*- mode: python -*- a = Analysis([‘AMOS_Visualizer.py’], pathex=[‘C:\\Users\\elu\\PycharmProjects\\Prosjektet\\Forsok splitting’], hiddenimports=[], hookspath=None, runtime_hooks=None) for d in a.datas: if ‘pyconfig’ in d[0]: a.datas.remove(d) break a.datas += [(‘Logo.png’,’C:\\Users\\elu\\PycharmProjects\\Prosjektet\\Forsok splitting\\Logo.png’, ‘Data’)] pyz = PYZ(a.pure) exe = EXE(pyz, a.scripts, a.binaries, a.zipfiles, a.datas, name=”AMOS_Visualizer.exe”, debug=False, strip=None, upx=True, console=True, icon=’C:\\Users\\elu\\PycharmProjects\\Prosjektet\\Forsok splitting\\AMOS.ico’) … Read more

Pyinstaller adding data files

As others (@Anson Chan, @schlimmchen) have said: If you want to add some extra files, you should use Adding Data Files. Two ways to implement Command Line: add parameter to –add-data Spec file: add parameter to datas= Generated when running pyinstaller the first time. Then later you can edit your *.spec file. Then running pyinstaller … Read more