Installing generativepy

By Martin McBride, 2023-12-07

generativepy is reasonably easy to install, but it has quite a few dependencies. They are mainly well-known Python packages, so it should be easy to find detailed instructions online.

The easiest way to install the dependencies is to use a package manager. I use conda to install NumPy and most of the other packages, and pip to install other packages that are only available vis PiPy.

generativepy also uses a few command line utilities that need to be installed on the system to allow certain features to be used.

You don't necessarily need to install every single package listed here. There are only a few core packages that are absolutely required, the rest are only needed if you use particular features of the library.

Core requirements

generativepy is a Python library, so of course you will need Python installed on your system. Version 3.10 or later is required, see python.org for details.

You will also need the generativepy library itself, which can be installed using:

pip install generativepy

Alternatively, the latest sources can be obtained from github.

Finally, you will need to install the following core libraries:

  • cairo 1.16.0 or later
  • numpy 1.21.5 or later
  • pillow 8.3.0 or later

These are the minimum versions that have been verified as working. It will usually be ok to use later versions.

Formula support

The formula module supports rendering equations for uses in generativepy images and animations. It requires the following command line utilities to be installed on the system:

  • latex (for example pdfTex 1.40.18 or later).
  • dvipng 1.15 or later

Movie creation

Creating movies requires:

  • moviepy 1.01 or later

Animated GIFs

Creating animated GIfs requires:

  • imageio 2.13.5 - a version 2.x is currently required, as version 3.x had a different interface.

Currently, the code relies on an older version of imageio, this will be fixed in a future version of generativepy. This feature also requires the following command line utility to be installed on the system:

  • gifsicle 1.91 or later

Experimental OpenGL based 3d graphics

Creating 3d graphics using the OpenGL pipeline requires:

moderngl 5.6.4 or later

Experimental POV-ray based 3d graphics

Creating 3d graphics using the POV-ray pipeline requires:

vapory 0.1.2 or later

It also requires POV-ray 3.7.0 or later to be installed on the system.

See also

Join the GraphicMaths Newletter

Sign up using this form to receive an email when new content is added:

Popular tags