Is it possible to build a single-binary or single-directory package with PyInstaller
that uses pypy
as interpreter?
Any special tricks to do that?
Some alternative to PyInstaller
?
If not, what are the fundamental technical reasons?
Notes why/how pyinstaller doesn't doesn't with pypy out of the box:
In PyInstaller it is easy to create one exe, By default both create a bunch of exes & dlls. In py2exe its easier to embed manifest file in exe, useful for run as administrator mode in windows vista and beyond. Pyinstaller is modular and has a feature of hooks to include files in the build that you like.
PyInstaller reads a Python script written by you. It analyzes your code to discover every other module and library your script needs in order to execute. Then it collects copies of all those files – including the active Python interpreter!
PyInstaller will bundle the Python script and all its dependencies into a single self-contained standalone executable which can be distributed to other systems or users without having Python or any modules, including teradatasql installed.
I have tried this out and it failed, on many occasions, because PyPy is only able to work with a few subset of what CPython uses. PyInstaller is a full blown CPython application, so there are not able to communicate.
PyInstaller's mechanism is sensitive to how CPython works, so PyPy can introduce some issues. This is what you'll get when trying to run PyInstaller in a PyPy virtual environment:
OSError: Python library not found: Python, .Python, libpython3.5.dylib, libpython3.5m.dylib This would mean your Python installation doesn't come with proper library files. This usually happens by missing development package, or unsuitable build parameters of Python installation. * On Debian/Ubuntu, you would need to install Python development packages * apt-get install python3-dev * apt-get install python-dev * If you're building Python by yourself, please rebuild your Python with `--enable-shared` (or, `--enable-framework` on Darwin)
If you need improved speed and hiding your code away from people, you can try out Cython. I use both Cython and PyInstaller a lot, and I love their cross platform nature.
When you are through with both, you can then use PyInstaller & CPython to package your app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With