Comments (7)
I can confirm that, there must be a problem with how pyinstaller
manages entry points, because it works when launched via Python itself.
The point is hexrec
registers file types via the hexrec_types
list provided to setuptools.setup(entry_points=...)
. For some reason, that list is not being read by the hexrec
package embedded in the generated executable.
I'm not sure I'm able to fix that, or rather create some workaround.
from hexrec.
Here I found something that seems to work:
pyinstaller/pyinstaller#3050
I will commit changes soon.
from hexrec.
@rajanimindteck: tested locally with the latest commit: 39e1096
Please confirm to close the issue.
from hexrec.
PyInstaller issue is solved with this commit.
from hexrec.
@TexZK: Issue is not fixed for me even when using commit 39e1096.
In contrast to OP I do not try to generate an .exe for hexrec itself, but import hexrec in another module and try to package that as an executable file.
mymodule.py
import hexrec.records as hr
...
- Create and activate a venv
- Upgrade pip
- Install hexrec (commit 39e1096) and pyinstaller
- pyinstaller -y --name mymodule ./mymodule.py
- Compiled exe throws error:
KeyError: 'unsupported extension: .s19'
[13216] Failed to execute script mymodule
from hexrec.
@kiesner thanks for pointing this out. I actually have the same problem with an utility script I use at work.
In order to let pyinstaller compile the script into an executable file, I added the following stuff at the beginning as a workaround:
import sys
from typing import MutableMapping
from typing import Type
from typing import cast
import hexrec.records as hr
# Fix missing entry_points with pyinstaller
if hasattr(sys, 'frozen') and getattr(sys, 'frozen') and hasattr(sys, '_MEIPASS'):
import hexrec.formats.intel
import hexrec.formats.motorola
_record_types = cast(MutableMapping[str, Type[hr.Record]], hr.RECORD_TYPES)
_record_types.update({
'intel': hexrec.formats.intel.Record,
'motorola': hexrec.formats.motorola.Record,
})
I hope to find a consistent way to make entry_points
work, otherwise I will switch back to the old solution, where I populated hexrec.records.RECORD_TYPES
manually to their defaults, instead of relying on entry_points
.
from hexrec.
@kiesner You can try again with the latest commit (57f0e31)
from hexrec.
Related Issues (20)
- Python 3.10 not supported HOT 3
- filling sequence error HOT 3
- Update docs for `bytesparse`
- Deprecate `hexrec.blocks`
- blocks.find search not spanning over neighbors and only doing linear search HOT 3
- hexrec.records.save_blocks always adding a dummy Linear Address Record HOT 1
- Use `Ellipsis` as per `intel` format HOT 1
- Condition `columns == None` not supported HOT 1
- Update README for 0.3.x
- `hexrec.records.save_*()` should also add `build_*args` HOT 1
- Add CLI commands dedicated to each officially supported type family
- merge_records writes header records to memory HOT 2
- Add support for Python 3.12 HOT 1
- Let CLI `xxd` load a hexadecimal record file as memory image instead of plain binary file HOT 1
- Organize docs manually (no autosummary)
- Microchip SQTP addressing by words HOT 1
- Add `xxd` examples from Linux docs HOT 1
- Add `SparseMemoryIO` to `xxd` HOT 1
- Add align method HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hexrec.