Skip to content

Installation

Tom Swirly edited this page Jun 17, 2017 · 19 revisions

For an AllPixel specific quick start guide with examples, check out the AllPixel Wiki

Requirements

BiblioPixel v3 requires at least Python 3.4. Python 2 is deprecated and we urge you to move away from it - if your application requires Python 2, then there's an unsupported legacy BiblioPixel 2 that works with Python 2.7.

It is recommended (but not necessary) to use virtualenv to isolate your installation of BiblioPixel. If you do not use virtualenv and are running on either Linux or MacOS, then in the instructions below, you need to use sudo pip instead of pip.

Easy Installation

The easiest way to acquire BiblioPixel is using pip. If you don't already have pip the easiest way is to download and run get-pip.py. Then install BiblioPixel as follows:

pip install BiblioPixel

This will automatically install the entire package and make it available to import from anywhere in python. However, this will not get you any example or testing scripts. Download from GitHub to obtain all the extras. TODO: is this true?

Manual Installation

TODO: do we need this section? Why would someone who wanted to do this not know how to do it?

Download the source package from GitHub and unzip the contents. Inside of the package directory run the command:

python setup.py install

BiblioPixel should now be available to import in your python script.

TODO: This next section needs a cleanup, and needs to mention bibliopixel, the script.

The source package also includes the following utility scripts in the util directory:

  • DeviceIDManager.py - Script for viewing and setting the device ID on the AllPixel
  • AllPixelConfigure.py - Script for setting up the AllPixel configuration without first writing script code.

Requirements

TODO: is this really needed here? Shouldn't we mention this only in the documentation of those packages?

While not absolutely needed for all scenarios, the following packages may be required:

  • pillow - Used for the image and ImageSequence modules.
  • py-spidev - Used for DriverSPIBase, LPD8806, and WS2801. Provides direct SPI port access on the Raspberry Pi, BeagleBone Black, and similar. Not absolutely required but increases performance. Will not install on Windows or Mac OS! There is no SPI port available on such systems.
  • pyserial - Used for Serial to access serial (COM) ports.

These packages can be installed via:

sudo pip install pillow
sudo pip install spidev
sudo pip install pyserial
#sudo not needed on Windows

TODO: this next section is wrong.

Or, to install everything at once, from the BiblioPixel package directory run:

sudo pip install -r requirements.txt
#sudo not needed on Windows

Note 1: Many Linux systems will already have pyserial installed! But it is likely not the correct version. Upgrade to the latest version with:

sudo pip install pyserial --upgrade

TODO: do we need this?

Note 2: It is always possible to install these modules either direct from source or with installer packages. If you already had any of these libraries installed with pip and then install via another method, or vice-versa, then both will be installed and python may not pick up the correct version. If upgrading the module, either uninstall the original first or use the same method used to install it in the first place. Modules that came with python can be considered to have been installed using pip.

On Windows, pillow may require some advanced development tools to be installed. If you are having trouble installing, try these pre-compiled binaries.

If running the above command under Windows or Mac OS, the spidev installation will fail. This is okay, as there are no SPI ports on such systems anyways.

Clone this wiki locally