Skip to content Skip to sidebar Skip to footer

Pypy And Pyinstaller

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?

Solution 1:

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.

Post a Comment for "Pypy And Pyinstaller"