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.
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.
You need the following additional python packages to run Picard from source:
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
You need need the following additional python packages to run Picard version 1 from source:
You need to install PyQt4 and libdiscid manually.
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
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.
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.
py setup.py build_locales -i
After you have done this, you can run Picard directly from the sources using:
If you want to build the Picard Windows installer executable you need additional Tools:
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:
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.
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.
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:
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.
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.
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.