Installation

Windows installation from a PyInstaller file

The idea of PyInstaller is that it takes a working Python virtual environment and packages it up (for that 32- or 64-bit OS and version of Python) so you don’t have to go through the rigmarole of installing from source [1]. So the installation is quite simple:

  • Install MySQL. (The alternative is PostgreSQL; see later.)

    • Browse to http://dev.mysql.com/downloads/installer/ and follow the instructions.
    • The web installer works fine here. Choosing the defaults works well, and you can add additional users during setup. The default port is 3306, and the default superuser account is root.
  • Obtain and unzip whisker_serial_order_0.3.3_windows.zip, or equivalent.

  • Run whisker_serial_order.exe.

Ubuntu installation from PyPI source

  • Install MySQL or PostgreSQL. See Databases.

  • You should have Python 3 already (it comes with Ubuntu).

  • Create a virtual environment, activate it, and install the Python things. To do this, start a shell and enter the following commands:

    python3 -m virtualenv ~/venv_whisker_serial_order
    source ~/venv_whisker_serial_order/bin/activate
    pip install whisker_serial_order
    

The SerialOrder program itself will now be accessible as the command whisker_serial_order without any PATH modifications as long as you have activated the virtual environment (the second command above).

After installation

  • Create a database. See Databases.

  • Compose your database URL. If you create a database named serialorder, with a user named researcher and a password of blueberry, then to use the MySQL Connector/Python interface, the URL would be:

    mysql+mysqlconnector://researcher:blueberry@localhost/serialorder
    
  • Tell SerialOrder about this URL, either via an environment variable or as a command-line parameter (see below). The simplest is as a command-line parameter, as below.

  • Launch SerialOrder:

    whisker_serial_order --dburl=your_URL_as_above
    
  • For details of all possible command-line options, use:

    whisker_serial_order --help
    
  • The first time you run it, you should get an error like “Database revision should be 0003 but is None”. Update the database with:

    whisker_serial_order --dburl=your_URL_as_above --upgrade-database
    

    Then re-run.

Footnotes

[1]

A bit of tweaking to the source is required, because things don’t live in the same directory structure as normal, but this is achievable. To build, you:

  1. check out the Git repository;
  2. create/activate the Python virtual environment;
  3. install (with pip install -e .);
  4. check it runs;
  5. pip install pyinstaller;
  6. run tools/make_pyinstaller_distributable.py.