def resource_path(relative_path):
""" Get absolute path to resource, works for dev and for PyInstaller """
try:
# PyInstaller creates a temp folder and stores path in _MEIPASS
base_path = sys._MEIPASS
except Exception:
base_path = os.path.abspath(".")
return os.path.join(base_path, relative_path)
refresh.setIcon(QtGui.QIcon(resource_path('refresh.png')))
pyinstaller your_game.py --noconsole --clean
PyInstaller analyzes myscript.py and:
Writes myscript.spec in the same folder as the script.
For certain uses you may edit the contents of myscript.spec (described under Using Spec Files). After you do this, you name the spec file to PyInstaller instead of the script:
pyinstaller myscript.spec
pyinstaller your_game.py
a = Analysis(
.....
)
....
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas # убедитесь что эта строча есть
......
)