Setting up the Build Environment, Tools/environment_install/install-prereqs-ubuntu.sh -y

I’ve tried multiple time to get the Tools/environment_install/install-prereqs-ubuntu.sh -y script to install the necessary dependencies; however, I seem to get python related errors. I have Python 3.8 installed. I’m using Ubuntu under the Windows 10 WSL.
Python was previously installed through Windows. I wasn’t able to invoke python.exe via bash and tried to fix by using:
sudo apt-get install python-is-python3
then again: Tools/environment_install/install-prereqs-ubuntu.sh -y
from ardupilot directory. The script runs for a few seconds and ends with these errors/comments. I cannot get past this:

Package python-scipy is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package python-empy is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package python-pip is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
python3-pip

E: Package ‘python-pip’ has no installation candidate
E: Package ‘python-matplotlib’ has no installation candidate
E: Unable to locate package python-serial
E: Package ‘python-scipy’ has no installation candidate
E: Unable to locate package python-opencv
E: Package ‘python-empy’ has no installation candidate
jgiessel@DESKTOP-ISNCK32:~/ardupilot$

Please help, I’ve tried completely reinstalling Ubuntu, cloning ardupilot again… and same error with Python. Do I need Python 2.7 as well?
Thanks for help,
Zac G.

Which version of Ubuntu do you have?
Seems to be a Python version issue.
The last time I check, you shouldn’t see any errors with the latest Ubuntu.

jgiessel@DESKTOP-ISNCK32:~/ardupilot$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal
jgiessel@DESKTOP-ISNCK32:~/ardupilot$ Tools/environment_install/install-prereqs-ubuntu.sh -y
---------- Tools/environment_install/install-prereqs-ubuntu.sh start ----------

  • OPT=/opt
  • BASE_PKGS=‘build-essential ccache g++ gawk git make wget’
  • PYTHON_PKGS=‘future lxml pymavlink MAVProxy pexpect’
  • PX4_PKGS=‘python-argparse openocd flex bison libncurses5-dev autoconf texinfo libftdi-dev zlib1g-dev zip genromfs python-empy cmake cmake-data’
  • ARM_LINUX_PKGS=‘g+±arm-linux-gnueabihf pkg-config-arm-linux-gnueabihf’
  • SITL_PKGS=‘libtool libxml2-dev libxslt1-dev python-dev python-pip python-setuptools python-matplotlib python-serial python-scipy python-opencv python-numpy python-pyparsing xterm lcov gcovr’
  • ASSUME_YES=false
  • QUIET=false
    ++ uname -m
  • MACHINE_TYPE=x86_64
  • ‘[’ x86_64 == x86_64 ‘]’
  • PX4_PKGS+=’ libc6-i386’
  • ARM_ROOT=gcc-arm-none-eabi-6-2017-q2-update
  • ARM_TARBALL=gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2
  • ARM_TARBALL_URL=http://firmware.ardupilot.org/Tools/STM32-tools/gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2
  • ARDUPILOT_TOOLS=Tools/autotest
  • OPTIND=1
  • getopts y opt
  • case “$opt” in
  • ASSUME_YES=true
  • getopts y opt
  • APT_GET=‘sudo apt-get’
  • true
  • APT_GET=‘sudo apt-get --assume-yes’
  • false
  • dpkg-query -l lsb-release
    Desired=Unknown/Install/Remove/Purge/Hold
    | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
    |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
    ||/ Name Version Architecture Description
    ++±==============-=============-============-=============================================
    ii lsb-release 11.1.0ubuntu2 all Linux Standard Base version reporting utility
  • read -r UBUNTU_CODENAME
    ++ lsb_release -c -s
  • ‘[’ focal = precise ‘]’
  • ‘[’ focal = trusty ‘]’
  • sudo usermod -a -G dialout jgiessel
  • dpkg-query -l modemmanager
    dpkg-query: no packages found matching modemmanager
  • sudo apt-get --assume-yes update
    Hit:1 Index of /ubuntu focal InRelease
    Hit:2 Index of /ubuntu focal-updates InRelease
    Get:3 Index of /ubuntu focal-security InRelease [114 kB]
    Get:4 Index of /ubuntu focal-backports InRelease [108 kB]
    Fetched 222 kB in 2s (113 kB/s)
    Reading package lists… Done
  • apt-cache search python-wxgtk3.0
  • grep wx
    python-wxgtk3.0 - Python interface to the wxWidgets Cross-platform C++ GUI toolkit
    python-wxgtk3.0-dev - Development files for wxPython
  • SITL_PKGS+=’ python-wxgtk3.0 libtool-bin’
    ++ apt-cache search -n ‘^realpath$’
  • RP=
  • ‘[’ -n ‘’ ‘]’
  • sudo apt-get --assume-yes install build-essential ccache g++ gawk git make wget libtool libxml2-dev libxslt1-dev python-dev python-pip python-setuptools python-matplotlib python-serial python-scipy python-opencv python-numpy python-pyparsing xterm lcov gcovr python-wxgtk3.0 libtool-bin python-argparse openocd flex bison libncurses5-dev autoconf texinfo libftdi-dev zlib1g-dev zip genromfs python-empy cmake cmake-data libc6-i386 g+±arm-linux-gnueabihf pkg-config-arm-linux-gnueabihf
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Note, selecting ‘python-dev-is-python2’ instead of ‘python-dev’
    Note, selecting ‘libpython2.7-stdlib’ instead of ‘python-argparse’
    Package python-matplotlib is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

Package python-scipy is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package python-empy is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package python-pip is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
python3-pip

E: Package ‘python-pip’ has no installation candidate
E: Package ‘python-matplotlib’ has no installation candidate
E: Unable to locate package python-serial
E: Package ‘python-scipy’ has no installation candidate
E: Unable to locate package python-opencv
E: Package ‘python-empy’ has no installation candidate
jgiessel@DESKTOP-ISNCK32:~/ardupilot$ python -V
Python 3.8.10
jgiessel@DESKTOP-ISNCK32:~/ardupilot$

Appreciate any help!!
Thanks! Zac

OK.
Might have been a long time ago last I check :slightly_smiling_face:.
Does sudo apt-get update work and without any errors?
Just checking this because sometimes the Win10 firewall might block the traffic.
Might be a good idea to send the entire output for debugging.

Try this.

I just created a fresh 20.04 WSL 2 distro and everything went fine. Are you cloning from a branch that is close to the ArduPilot master branch?

Hi TunaLobster: I cloned using ArduSub instructions here: Build ArduSub · GitBook

    git clone https://github.com/ardupilot/ardupilot.git
    cd ardupilot
    git submodule update --init --recursive

Compiling
Before compiling ArduSub, first checkout the ArduSub-stable tag into a new branch (here we call it new-branch):

git fetch --tags
git checkout ArduSub-stable -b new-branch
git submodule update --init --recursive

"

Hello,
I ran into an issue after the sudo python2 get-pip.py
command.

final error is here:
jgiessel@DESKTOP-ISNCK32:~$ sudo python2 get-pip.py
ERROR: This script does not work on Python 2.7 The minimum supported Python version is 3.7. Please use https://bootstrap.pypa.io/pip/2.7/get-pip.py instead.
jgiessel@DESKTOP-ISNCK32:~$

The whole sequence is here:
Ubuntu_commands_fail_21FEB2022.txt (10.4 KB)

Shall I try the suggestion:
https://bootstrap.pypa.io/pip/2.7/get-pip.py ??
Thanks.

That would be because the ArduSub-stable branch has not had the install script updated since…2019. And you are using a distro that was release in 2020 and we updated the install script in ArduPilot master. The install script would work with Ubuntu 20.04 and ArduSub-beta.

@jaxxzer What would you recommend in this case? Back porting the install script changes for the distro detection wouldn’t be too bad. Would the beta tag be an ok option to use?

Ok, I completely deleted the /ardupilot directory from my system.
Then per Ardupilot instructions: created a fork of the main Ardupilot repository and my GitHub account and cloned the fork.
The Tools/environment_install/install-prereqs-ubuntu.sh -y script works now ye!
A question remains: Is the latest stable version of ArduSub included in the main Ardupilot repository or should I follow the instructions from Ardusub:

git fetch --tags
git checkout ArduSub-stable -b new-branch
git submodule update --init --recursive

Advice please!
Zac

This conversation has been continued on the ArduSub forum:

EDIT: The ArduSub-stable tag has been properly updated now, to match the Sub-4.0 branch.

@TunaLobster FYI you’ll have more luck tagging @williangalvani for ArduSub stuff now - Jacob has changed focus, and Willian is now doing most of the ArduSub maintenance/development.

1 Like