Home        Store        Learn        Blog

Waf Fails to Compile

I have been trying to create a custom configuration. I have tried to setup the environment on 3 different machines using different methods. So far I have only gotten waf to configure on one machine. This machine is a Windows 10 running Ubuntu. I have gone through the installation steps
in the Ardusub documentation. I can configure waf for several autopilot selections but when I try to run ./waf sub, I get errors. Here is a screen shot.

Hi @lunarminer,

The error you’re getting is a Python traceback, telling you it can’t find the future module. That’s a library that helps to ease the conversion for code that needs to run on python 2 and python 3. There are multiple possible reasons for the error (e.g. future module not installed, program using a different version of python to the corresponding pip installation, etc), so I did a quick search for “ArduPilot no module named future” which brought up this GitHub issue, which suggests basically just a few different ways of installing future for different python versions to try to get the right one.

It seems like python2 -m pip install future is likely to fix your problem, but do also note this comment, which rightly notes that python2 is passed its end of life (as of the start of 2020) so shouldn’t be used anymore if at all possible. I’m not sure how the/your waf build is set up here - ideally this would already run as python3 by default, but I’m not sure which instructions you’re following or who is in charge of updating them (if anyone).

I finally got it to compile on the Windows 10 machine running Ubuntu.
The core problem was that there was a broken script which prevented me from installing
packages and from upgrading python. Once I located the script and renamed it, then I could install python3.8 and then I could compile waf.

1 Like

Glad you managed to sort this out, and great to hear you got it working with Python 3.8 instead of Python 2 :slight_smile: