SITL install not working

I am following the install instructions located at https://ardupilot.org/dev/docs/building-setup-linux.html#building-setup-linux

When I do “Tools/environment_install/install-prereqs-ubuntu.sh -y” I am greeted with a long list of errors, including the following:

  • E: Unable to locate package python-pip
  • E: Package ‘python-matplotlib’ has no installation candidate
  • E: Package ‘python-serial’ has no installation candidate
  • E: Package ‘python-scipy’ has no installation candidate
  • E: Unable to locate package python-opencv
  • E: Unable to locate package libcsfml-audio2.4
  • E: Couldn’t find any package by glob ‘libcsfml-audio2.4’
  • E: Couldn’t find any package by regex ‘libcsfml-audio2.4’
  • E: Unable to locate package libcsfml-graphics2.4
  • E: Couldn’t find any package by glob ‘libcsfml-graphics2.4’
  • E: Couldn’t find any package by regex ‘libcsfml-graphics2.4’
  • E: Unable to locate package libcsfml-network2.4
  • E: Couldn’t find any package by glob ‘libcsfml-network2.4’
  • E: Couldn’t find any package by regex ‘libcsfml-network2.4’
  • E: Unable to locate package libcsfml-system2.4

I’ve been scouring the internet for answers to this but I can only find issues raised on github that mark it as an ongoing bug. I really, really want to be able to run simulations on (Linux Mint) Ardupilot/mission planner, what am I doing wrong?

PS I wasn’t sure which forum to ask this in, sorry

Try doing a sudo apt update first. I took a quick look at the install script and I don’t think it does that for you. There might also be just enough differences between Ubuntu and Mint to cause a problem, but I’m also not familiar with Mint to know how it handles package repos.

I have done a sudo apt update. I think it is something to do with the script using python 2 instead of python3, but I’m not certain and if that is the case I’m not sure what I can do about it

That install script doesn’t know how to handle Mint versions. So it is guessing that python packages from apt should start with python rather than python3.

The quick and dirty change would be to change this bit of code to be python3. There might be other package differences between Mint and Ubuntu that cause other problems though so YMMV.

Thanks! That’s got rid of the first few python related errors so I’m moving in the right direction. Still getting this bunch though; am I missing a repository? I have done an apt update prior to this…

E: Unable to locate package libcsfml-audio2.4
E: Couldn't find any package by glob 'libcsfml-audio2.4'
E: Couldn't find any package by regex 'libcsfml-audio2.4'
E: Unable to locate package libcsfml-graphics2.4
E: Couldn't find any package by glob 'libcsfml-graphics2.4'
E: Couldn't find any package by regex 'libcsfml-graphics2.4'
E: Unable to locate package libcsfml-network2.4
E: Couldn't find any package by glob 'libcsfml-network2.4'
E: Couldn't find any package by regex 'libcsfml-network2.4'
E: Unable to locate package libcsfml-system2.4
E: Couldn't find any package by glob 'libcsfml-system2.4'
E: Couldn't find any package by regex 'libcsfml-system2.4'
E: Unable to locate package libcsfml-window2.4
E: Couldn't find any package by glob 'libcsfml-window2.4'
E: Couldn't find any package by regex 'libcsfml-window2.4'
E: Unable to locate package libsfml-audio2.4
E: Couldn't find any package by glob 'libsfml-audio2.4'
E: Couldn't find any package by regex 'libsfml-audio2.4'
E: Unable to locate package libsfml-graphics2.4
E: Couldn't find any package by glob 'libsfml-graphics2.4'
E: Couldn't find any package by regex 'libsfml-graphics2.4'
E: Unable to locate package libsfml-network2.4
E: Couldn't find any package by glob 'libsfml-network2.4'
E: Couldn't find any package by regex 'libsfml-network2.4'
E: Unable to locate package libsfml-system2.4
E: Couldn't find any package by glob 'libsfml-system2.4'
E: Couldn't find any package by regex 'libsfml-system2.4'
E: Unable to locate package libsfml-window2.4
E: Couldn't find any package by glob 'libsfml-window2.4'
E: Couldn't find any package by regex 'libsfml-window2.4'

A few lines later there is SITLFML_VERSION. Go for the one that is inside the else. Change both of those strings to 2.5.

Thank you Charlie, with your help it is now working!

1 Like

Doesn’t look like this is limited to Mint unfortunately, I’ve hit the almost the exact same issue on a fresh ubuntu 20.04 in WSL following the tutorial.

E: Unable to locate package python-pip
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: Unable to locate package libcsfml-audio2.4
E: Couldn’t find any package by glob ‘libcsfml-audio2.4’
E: Couldn’t find any package by regex ‘libcsfml-audio2.4’
E: Unable to locate package libcsfml-graphics2.4
E: Couldn’t find any package by glob ‘libcsfml-graphics2.4’
E: Couldn’t find any package by regex ‘libcsfml-graphics2.4’
E: Unable to locate package libcsfml-network2.4
E: Couldn’t find any package by glob ‘libcsfml-network2.4’
E: Couldn’t find any package by regex ‘libcsfml-network2.4’
E: Unable to locate package libcsfml-system2.4
E: Couldn’t find any package by glob ‘libcsfml-system2.4’
E: Couldn’t find any package by regex ‘libcsfml-system2.4’
E: Unable to locate package libcsfml-window2.4
E: Couldn’t find any package by glob ‘libcsfml-window2.4’
E: Couldn’t find any package by regex ‘libcsfml-window2.4’
E: Unable to locate package libsfml-audio2.4
E: Couldn’t find any package by glob ‘libsfml-audio2.4’
E: Couldn’t find any package by regex ‘libsfml-audio2.4’
E: Unable to locate package libsfml-graphics2.4
E: Couldn’t find any package by glob ‘libsfml-graphics2.4’
E: Couldn’t find any package by regex ‘libsfml-graphics2.4’
E: Unable to locate package libsfml-network2.4
E: Couldn’t find any package by glob ‘libsfml-network2.4’
E: Couldn’t find any package by regex ‘libsfml-network2.4’
E: Unable to locate package libsfml-system2.4
E: Couldn’t find any package by glob ‘libsfml-system2.4’
E: Couldn’t find any package by regex ‘libsfml-system2.4’
E: Unable to locate package libsfml-window2.4
E: Couldn’t find any package by glob ‘libsfml-window2.4’
E: Couldn’t find any package by regex ‘libsfml-window2.4’
E: Package ‘python-empy’ has no installation candidate

Solution appears to be (By appears I mean its installed the packages and gotten rid of the errors but I’m not sure if I was supposed to use Python 2 or 3):

SITLFM_VERSION changed to 2.5 in both lines of the “else” option as described by @TunaLobster

References to the missing python packages changed from python-XXX to python3-XXX.

That’s interesting because the install script should have caught the Focal Fossa version name here.

@khancyr I know you’ve been looking at the install script lately.

I have just tried on a fresh 20.04 VM and it is working as intend.
One issue with WSL could be the the VM was on 18.04 and was upgraded to 20.04 and thus default python is still python2 and that break everything.

For mint, just replace focal by the name of the mint current release and it should work. In case we cannot identify the ubuntu version we are still falling back to python2 releases. It may change soon. And I have a patch to autodetect sfml version automatically.

@khancyr You’re probably right with regards the upgrade issue, I did have an 18.04 version installed and just added 20.04 if thats what you meant by upgrading? I didn’t upgrade the vm as such I simply installed the new version but I suspect that might be what you’re referring to?

I ran into no end of issues, ended up applying those fixes as mentioned then removing Python2 and installing python-is-python3 which has successfully built now, presumably fixing the issues.

Having some more issues with this. I am installing on a new Mint computer and trying the install script with the modifications made previously, but am now getting this error:

fatal: remote error: upload-pack: not our ref: 19222[long number]
fatal: the remote end hung up unexpectedly
Fetched in submodule path ‘/modules/uavcan’ but it did not contain [long number]. Direct fetching of that commit failed.

What gives? Seems I can’t get one of the uavcan modules?

EDIT - I did a restart and now sim_vehicle.py seems to be on PATH ie I can run it from anywhere, but when I do it says there is no module named pymavlink despite that I have installed it with pip. Is it running with python2 instead of python3? I cannot install anything for python2 as I cannot install the original pip