2016-07-05 11:38:54 +02:00
|
|
|
Running from source
|
|
|
|
--------------------
|
2012-12-21 08:51:59 +01:00
|
|
|
|
2016-07-05 11:38:54 +02:00
|
|
|
For non-developers who want to try this development code, the easiest way is
|
|
|
|
to use a binary package - please see:
|
2014-04-12 06:33:53 +02:00
|
|
|
|
2016-07-05 11:38:54 +02:00
|
|
|
https://anki.tenderapp.com/discussions/beta-testing
|
|
|
|
|
|
|
|
You are welcome to run Anki from source instead, but it is expected that you
|
|
|
|
can sort out all dependencies and issues by yourself - we are not able to
|
|
|
|
provide support for problems you encounter when running from source.
|
|
|
|
|
|
|
|
Anki requires:
|
|
|
|
|
2018-06-07 03:36:11 +02:00
|
|
|
- Python 3.6+
|
2018-12-10 04:13:24 +01:00
|
|
|
- Qt 5.9.x/5.11.x/5.12.x and a PyQT that supports it
|
2017-10-02 09:24:03 +02:00
|
|
|
- mpv
|
2016-07-05 11:38:54 +02:00
|
|
|
- lame
|
|
|
|
|
|
|
|
It also requires a number of Python packages, which you can grab via pip:
|
|
|
|
|
|
|
|
$ pip3 install -r requirements.txt
|
|
|
|
|
2018-12-10 04:13:24 +01:00
|
|
|
If you're on a Linux distribution that packages a compatible Qt then you can
|
|
|
|
use the distro's packages. Make sure you install the development tools (eg
|
2018-07-12 08:09:14 +02:00
|
|
|
pyqt5-dev-tools) as well.
|
|
|
|
|
|
|
|
If you're on another platform or your distro has the wrong Qt version, you
|
|
|
|
can install PyQt with pip:
|
|
|
|
|
2019-02-15 13:51:57 +01:00
|
|
|
$ pip3 install PyQt5 PyQtWebEngine
|
2012-12-21 08:51:59 +01:00
|
|
|
|
|
|
|
To use the development version:
|
|
|
|
|
|
|
|
$ git clone https://github.com/dae/anki.git
|
|
|
|
$ cd anki
|
|
|
|
$ ./tools/build_ui.sh
|
|
|
|
|
2014-04-12 06:33:53 +02:00
|
|
|
If you get any errors, you will not be able to proceed, so please return to
|
|
|
|
the top and check the requirements again.
|
|
|
|
|
|
|
|
ALL USERS: Make sure you rebuild the UI every time you git pull, otherwise you
|
|
|
|
will get errors down the road.
|
2012-12-21 08:51:59 +01:00
|
|
|
|
|
|
|
The translations are stored in a bazaar repo for integration with Launchpad's
|
|
|
|
translation services. If you want to use a language other than English:
|
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
$ mv anki dtop # i18n code expects anki folder to be called dtop
|
2018-02-07 18:57:25 +01:00
|
|
|
$ bzr branch lp:anki i18n
|
2012-12-21 08:51:59 +01:00
|
|
|
$ cd i18n
|
|
|
|
$ ./update-mos.sh
|
|
|
|
$ cd ../dtop
|
|
|
|
|
|
|
|
And now you're ready to run Anki:
|
2012-12-21 11:40:42 +01:00
|
|
|
$ ./runanki
|
2012-12-21 08:51:59 +01:00
|
|
|
|
2013-01-18 22:38:16 +01:00
|
|
|
If you get any errors, please make sure you don't have an older version of
|
|
|
|
Anki installed in a system location.
|
|
|
|
|
2019-04-29 04:40:44 +02:00
|
|
|
To run the unit tests, you will need to install nose and mock from your
|
|
|
|
distro, or with pip:
|
2018-07-12 08:09:14 +02:00
|
|
|
|
2019-04-29 04:40:44 +02:00
|
|
|
$ pip3 install nose mock
|
2018-07-12 08:09:14 +02:00
|
|
|
|
2016-08-16 07:07:29 +02:00
|
|
|
Before contributing code, please read README.contributing.
|
2012-12-21 08:51:59 +01:00
|
|
|
|
|
|
|
If you'd like to contribute translations, please see the translations section
|
|
|
|
of http://ankisrs.net/docs/manual.html#_contributing
|
2014-05-10 07:15:13 +02:00
|
|
|
|
2016-07-05 11:38:54 +02:00
|
|
|
Windows & Mac users
|
|
|
|
---------------------
|
|
|
|
|
|
|
|
The following was contributed by users in the past and will need updating
|
|
|
|
for the latest version. It is left here in case it is any help:
|
|
|
|
|
|
|
|
Windows:
|
2014-05-10 07:15:13 +02:00
|
|
|
|
|
|
|
I have not tested the build scripts on Windows, so you'll need to solve any
|
|
|
|
problems you encounter on your own. The easiest way is to use a source
|
|
|
|
tarball instead of git, as that way you don't need to build the UI yourself.
|
2014-11-29 08:49:30 +01:00
|
|
|
|
|
|
|
If you do want to use git, two alternatives have been contributed by users. As
|
|
|
|
these are not official solutions, I'm afraid we can not provide you with any
|
|
|
|
support for these.
|
|
|
|
|
|
|
|
A powershell script:
|
|
|
|
|
|
|
|
https://gist.github.com/vermiceli/108fec65759d19645ee3
|
|
|
|
|
|
|
|
Or a way with git bash and perl:
|
2014-05-10 07:15:13 +02:00
|
|
|
|
|
|
|
1) Install "git bash".
|
|
|
|
2) In the tools directory, modify build_ui.sh. Locate the line that reads
|
2019-07-29 11:10:34 +02:00
|
|
|
"pyuic5 --from-imports $i -o $py.tmp" and alter it to be of the following form:
|
2014-05-10 07:15:13 +02:00
|
|
|
"<python-path-string>" "<pyuic-path-string>" $i -o $py
|
|
|
|
These two paths must point to your python executable, and to pyuic.py, on your
|
|
|
|
system. Typical paths would be:
|
|
|
|
<python-path> = C:\\Python27\\python.exe
|
|
|
|
<pyuic-path-string> = C:\\Python27\\Lib\\site-packages\\PyQt4\\uic\\pyuic.py
|
2016-04-23 00:51:43 +02:00
|
|
|
|
2016-07-05 11:38:54 +02:00
|
|
|
Mac:
|
2016-04-23 00:51:43 +02:00
|
|
|
|
|
|
|
These instructions may be incomplete as prerequisites may have already been
|
|
|
|
installed. Most likely you will need to have installed xcode
|
|
|
|
(https://developer.apple.com/xcode/)
|
|
|
|
|
|
|
|
Install homebrew (http://brew.sh/) and then install Anki prerequisites:
|
|
|
|
|
2018-02-21 20:48:18 +01:00
|
|
|
$ brew install python mplayer lame portaudio
|
2016-04-23 00:51:43 +02:00
|
|
|
|
|
|
|
Now you can follow the development commands at the start of this document.
|