Build on Windows

This page is for Microsoft Windows users who want to contribute to the development of MusicBrainz Picard or for other reasons want to be able to run Picard from source code. It explains how to install the 3rd party software needed to run from source and also to build the Picard for Windows installer executable.

Requirements

Picard development (i.e. Github's master branch) is now focused on Picard version 2, which uses Python 3 and PyQt5. However if you need to test something in Picard version 1, then a separate branch 1.4.x is available to run and this uses Python 2 and PqQt4. Instructions for building each environment are provided below.

Downloading Picard source

Install GitHub Desktop or an alternative Git tool of your choice and use it to create your own local Git clone of your own fork of the Picard's GitHub Repository.


Python for Picard version 2

Python 3.5 or newer

  • Download and install Python 3 for Windows from https://python.org/downloads/. The latest version is recommended, but if you already have Python 3 installed then the minimum version is 3.5.
  • Python should add itself to your %PATH% environment variable, but if not add both the Python install directory and its scripts subdirectory to %PATH%

Python 3 packages

You need the following additional python packages to run Picard from source:

  • libdiscid
  • discid
  • PyQt 5.7.1 or later
  • Mutagen 1.37 or later

To install libdiscid, download "libdiscid-0.6.1-win32.zip" from https://musicbrainz.org/doc/libdiscid and put discid.dll in your Windows\System32 folder (Windows 32-bit) or Windows\SysWOW64 folder (Windows 64-bit).

The easiest way to install the remaining packages is to open an Administrator command prompt, navigate to the Picard source directory and type:

pip3 install -r requirements.txt

Alternatively to install them individually run:

pip3 install discid
pip3 install PyQt5>=5.7.1
pip3 install Mutagen>=1.37

Python for Picard version 1

Python 2.7.x

  • Download and install Python 2.7.x for Windows from https://python.org/downloads/
  • Python should add itself to your %PATH% environment variable, but if not add both the Python install directory and its scripts subdirectory to %PATH%

Python 2 packages

You need need the following additional python packages to run Picard version 1 from source:

  • PyQt 4.10 or later
  • libdiscid
  • discid
  • Mutagen 1.22 or later

You need to install PyQt4 and libdiscid manually.

  • PyQt4 - Riverbank Computing (authors of PyQt) no longer maintains an installation executable for the latest versions of PyQt. The most recent Windows installer, for PyQt v4.11.4, is suitable for Picard v1 and can be downloaded and run from SourceForge https://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.11.4/.
  • libdiscid - Download "libdiscid-0.6.1-win32.zip" from https://musicbrainz.org/doc/libdiscid and put discid.dll in your Windows\System32 folder (Windows 32-bit) or . Windows\SysWOW64 folder (Windows 64-bit).

The easiest way to install Mutagen and discid is using PIP. PIP is included as standard in Python 2.7.9 or later - so this is a good reason to upgrade if you already have an earlier version of Python 2.7 installed. Alternatively you can install PIP separately on earlier versions or install the above packages manually.

Assuming that you want to use PIP, open an Administrator command prompt, navigate to the Picard source directory and type:

pip2 install Mutagen>=1.22
pip2 install discid

Note: If you get an error message "'pip2' is not recognized as an internal or external command, operable program or batch file." try fixing this with:

python -m ensurepip --default-pip


Running Picard From Source

Chromaprint

If you want to run the Acoustid Scan function when running Picard from source, then you need to install the Chromaprint fpcalc program into your Picard source directory.

gettext

Picard uses gettext for internationalisation (i.e. for Picard to appear in your local language). To build the language mappings you need to install gettext.

After you have done this, you can run Picard directly from the sources using:

py tagger.py

Building the Installer

If you want to build the Picard Windows installer executable you need additional Tools:

py2exe

NSIS 2.46

Visual C++

Picard will run from source using a python version of the Levenshtein Distance fuzzy string comparison, however to build the C version for inclusion in the executable package you will need to download and install the Microsoft C++ compiler suitable for the version of Picard / Python you are building for:

Python 2 - Visual C++ 2015 Community

For Picard version 2 / Python 3, download Microsoft Visual C++ 14.0 standalone: Visual C++ Build Tools 2015 (x86, x64, ARM) from https://landinghub.visualstudio.com/visual-cpp-build-tools.

When you install, select the Windows 8.1 SDK for compile to work.

Python 2 - Visual C++ 2008 Express

For Picard version 1 / Python 2, download Visual C++ 2008 Express.

Note: There is also apparently a cut-down compiler specifically for compiling Python 2.7.x modules available at https://www.microsoft.com/en-gb/download/details.aspx?id=44266, though the author has not tried this.

Visual C++

Before you can build the Python executable and installer, you need to build the astrcmp C extension and language internationalisation. Start the VS console using "Visual Studio 2008 Command Prompt" or "Visual C++ 2015 MSBuild Command Prompt", go to the Picard source directory and run these commands:

python setup.py build_ext -i
python setup.py build_locales -i

Then you need to copy the following files from Visual Studio to to the source code directory, so that py2exe can find them:

  • Picard version 2 / Python 3 - msvcp140.dll from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\x86\Microsoft.VC140.CRT
  • Picard version 1 / Python 2 - msvcr90.dll and msvcp90.dll from C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT

You also need copy discid.dll (libdiscid) to the Picard source.

Then you can build the installer using this command:

python setup.py bdist_nsis

The setup is installer\picard-setup-x.x.exe and an executable for your system is dist\picard.exe, which you can use to create a desktop shortcut.

Known Issues

It is possible that the resulting picard.exe does not show the proper file icon. This is probably a bug of py2exe on Vista. You can fix the icon with the tool Resource Hacker or any other tool, that can edit the resources in executables.

Support

If these instructions do not work, please research and try to solve the problem yourself - and report the issue and answer in the Metabrainz Ticketing system under PICARD-WEBSITE and by submitting a PR against the Picard-Website Github Repository. If you are unable to resolve the issue after research and need further help, please use IRC freenode/#metabrainz to request help from the development community.