Running Dev Code on Windows

This page will walk you through setting up your environment to run the Anki developmental version on Windows. It has been tested on Windows XP, Vista and the Windows 7.

Note: This environment is not required for plugin development. Only follow these instructions if you are interested in testing the latest pre-release code or are interested in helping to develop Anki.

Install the latest release of Anki

Begin by installing the latest non-development release of Anki. Some of the files included in these releases will be needed later.

Install Python and Libraries

The next step is to install Python and the required libraries. Begin by using the latest version of all of the libraries. If the latest version of any of the libraries cause you problems, you can try reverting to the version linked to in the boxes, which are known to work. Use only the 32bit versions, even if you are running an 64bit OS.

Get the Dev Code

Now we'll setup the dev code. Begin by opening a Git Bash shell (Start -> Programs -> Git -> Git Bash) and change to a directory where you'd like to install the dev code. Now:

mkdir anki
cd anki
git clone git://github.com/dae/libanki.git
git clone git://github.com/dae/ankiqt.git
cd ankiqt

Keep this window open, you will use it again later.

Create the pyuic4 script

With your favorite editor, create a file called pyuic4 (no file extension) in the top level ankiqt directory (anki/ankiqt, not anki/ankiqt/ankiqt). Copy this text into the file:

"C:\Python26\python.exe" "C:\Python26\Lib\site-packages\PyQt4\uic\pyuic.py" $*

You can customize this if you installed Python to somewhere other than C:\Python26. It's based on C:\Python26\Lib\site-packages\PyQt4\pyuic4.bat.

Create the pyrcc4 script

With your favorite editor, create a file called pyrcc4 (no file extension) in the top level ankiqt directory (anki/ankiqt, not anki/ankiqt/ankiqt). Copy this text into the file:

"C:\Python26\Lib\site-packages\PyQt4\pyrcc4.exe" $*

You can customize this if you installed Python to somewhere other than C:\Python26.

Build the Forms

Next, build the forms:

./tools/build_ui.sh

Run this from the Bash shell we used earlier. You'll need to run this every time a file in the designer directory is changed.

Create a batch file

Now create a new batch file, called anki-dev.bat containing:

@set KANWADICTPATH=C:\Program Files\Anki\kakasi\share\kakasi\kanwadict
@set ITAIJIDICTPATH=C:\Program Files\Anki\kakasi\share\kakasi\itaijidict
@C:\Python26\python anki
@pause

The first two lines are only necessary if you have a Japanese deck with automatic reading generation.

Copy binaries and libraries from non-dev Anki

Copy msvcp71.dll and msvcr71.dll from C:\Program Files\Anki to C:\Windows\system

Still need to add a list of other files copy over (mplayer, sox, etc.)

Warning for plugins

Note that your working directory will be one level below than in a normal anki installation so some plugins might not find components they need. For instance the japanese support plugin will not find mecab in ./mecab because the current dir in the dev environment is anki/ankiqt rather than anki like in the normal installation.

Copy the matplotlib configuration file

The is an optional step that sets the graph fonts and colors. Copy C:\Program Files\Anki\matplotlibdata\matplotlibrc to the .matplotlib directory. This location has changed in recent versions:

Modify your path for kakasi

Add C:\Program Files\Anki\kakasi\bin to your user path environment variable. This change is only necessary if you have a Japanese deck with automatic reading generation.

You're done!

You can now run anki-dev.bat from a regular Windows command prompt, or by double clicking on it in Windows Explorer. If you run it from within the Git Bash shell, Anki will act like it's on Linux instead of Windows. This may cause problems related to the case-insensitivity of Windows filenames.

AnkiWiki: WindowsDevEnvironment (last edited 2010-05-17 08:52:40 by EnricoViali)