Anki does not run on Ubuntu 16.10 after upgrade from 16.04

I got Anki working again by installing python-qt4 from Jessie. I downloaded it from https://packages.debian.org/jessie/python-qt4 (scroll down to the bottom of the page for download links.. most will choose amd64)

and installed it via sudo dpkg -i python*.deb

Credits: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=826727 by Thomas Rebele


Simple solution (pre-compiled build)

The latest Anki releases are now available as compiled static builds which ship with all dependencies included. They should work right out of the box on most Linux distros.


Advanced solution (using source code tarball)

In some instances it might be necessary to run Anki from source, e.g. when developing an add-on or playing around with Anki's code. In those cases the following should work:

  1. Make sure you have all of Anki's dependencies satisfied (either by looking at the package dependencies and manually installing them, or by installing Anki from the official repositories in order to fetch its dependencies)
  2. Download the latest Anki 2.0.x source tarball from Anki's homepage and extract it
  3. Download the Debian Jessie version of python-qt4, as pointed out by davidbragat below, and extract it
  4. Find the PyQt4 folder located in the extracted python-qt4 debfile and move it to the extracted Anki source folder. In the end, the PyQt4 folder and runanki script should reside next to each other.
  5. Edit runanki in Anki's source folder and change

    import sys
    sys.path.insert(0, "/usr/share/anki")
    

    to

    #import sys
    #sys.path.insert(0, "/usr/share/anki")
    
  6. cd to Anki's source code folder and run ./runanki. Anki should now launch.