Building DroneKit-Python on Windows

This article shows how to set up an environment for developing DroneKit-Python on Windows.

Tip

If you just want to use DroneKit-Python on Windows then easiest way to get started is to use the Windows Installer. The installer is rebuilt with every patch release, so you can always be up to date with the latest features and bug fixes.

Install DroneKit using WinPython command line

First set up a command line DroneKit-Python installation using WinPython. This Python distribution already includes most of the needed dependencies (though you will need remove python-dateutil as the installation comes bundled with a version that does not work with DroneKit).

The steps to install this package and the most important add-on modules are:

  1. Download and run the correct WinPython installer (v2.7) for your platform (win32 vs win64).

    • Run the installer as an administrator (Right-click on file, select Run as Administrator).
    • When prompted for the destination location, specify C:Program Files (x86) (the default location is under the Downloads folder).
  2. Register the Python that came from WinPython as the preferred interpreter for your machine:

    Open the folder where you installed WinPython, run WinPython Control Panel and choose Advanced/Register Distribution.

    http://dev.ardupilot.com/wp-content/uploads/sites/6/2014/03/Screenshot-from-2014-09-03-083816.png
  3. Install DroneKit-Python and its remaining dependencies (including MAVProxy) from the public PyPi repository:

    Open the WinPython Command Prompt and run the following two commands:

    pip uninstall python-dateutil
    pip install droneapi
    

The dependencies above are all that are required to build DroneKit-Python and the MAVProxy command line (i.e. the minimum needed for testing). If you also want the MAVProxy console and map install:

  1. OpenCV

  2. WxPython

  3. Console

    • Open the WinPython command prompt and enter:

      pip install console
      

Fetch and build DroneKit source

  1. Fork the dronekit-python project on Github.

  2. Open the WinPython Command Prompt. Run the following commands to clone and build DroneKit (in the directory of your choice):

    git clone https://github.com/<your_fork_of_dronekit>/dronekit-python.git
    cd dronekit-python
    python setup.py build
    python setup.py install
    

Updating DroneKit

Navigate to your local git fork, pull the latest version, and rebuild/install:

cd <path-to-your-dronekit-fork>/dronekit-python
git pull
python setup.py build
python setup.py install