Error: make px4fmu-v2_default

Facing the error while compiling the pixhawk code with "make px4fmu-v2_default "
I already tried the “python -m easy_install empy catkin_pkg” and “python -m pip install empy catkin_pkg” Then “make distclean” and “make px4fmu-v2_default” but it didn’t change anything.

Please find the error I am facing:
python import error: No module named genmsg.template_tools

Required python packages not installed.

On a Debian/Ubuntu system please run:

sudo apt-get install python-empy
sudo pip install catkin_pkg

On MacOS please run:
sudo pip install empy catkin_pkg

On Windows please run:
easy_install empy catkin_pkg

[6/658] Generating git version header
ninja: build stopped: subcommand failed.
make[1]: *** [px4_fmu-v2_default] Error 1
make[1]: Leaving directory `/c/PX4/code/Firmware’
make: *** [px4fmu-v2_default] Error 2

Edit:
Sorry, I should read what you’re writing :smile:.

What system are you on?
If you’re on Ubuntu on Windows, you probably want to do:

sudo apt-get install python-empy
sudo pip install catkin_pkg

If you’re on Cygwin Windows:

easy_install empy catkin_pkg

I am using pixhawk_toolchain console on windows 7.

And I have already installed “catkin_pkg” and “empy” package. But still I am facing the same error.

@MaEtUgR any chance you could try to help here?

@JulianOes Let me try :blush:

@NitinNaik What is “pixhawk_toolchain console on windows 7”?
If it’s an old msys based toolchain or you built it up yourself chances are you are running against multiple issues even if you fixed that particular error. I’m telling you this not to intimidate but to save your time.

The simplest way to compile master branch for fmu-v2 is to take my ready to use installer and you will not have to deal with any missing piece: https://dev.px4.io/en/setup/dev_env_windows_cygwin.html

If you want to dig into extending the toolchain or figuring out all the necessary dependencies I enourage you to read the whole documentation page and you can also have a look at the scripts used to build that installer: https://github.com/PX4/windows-toolchain
The necessary python packages are installed here: https://github.com/PX4/windows-toolchain/blob/master/toolchain/cygwin64/install-cygwin-python-packages.bat#L8-L13
And “catkin_pkg” is none of them.

If you have further questions feel free to ask back.strong text

1 Like

@MaEtUgR Thanks for replying here…

I re-tried to compile the code using mentioned Cygwin tool but I am still getting the same error.

I have installed all the required dependencies / libraries given in https://github.com/PX4/windows-toolchain/blob/master/toolchain/cygwin64/install-cygwin-python-packages.bat#L8-L13

Please suggest how to overcome this error…

I re-tried to compile the code using mentioned Cygwin tool but I am still getting the same error.

I don’t understand why that should happen. So you installed the toolchain using the MSI installer but in which console with what repository did you try to compile?

Because if you install the cygwin toolchain, you use the toolchain’s cygwin console C:\PX4\run-console.bat and you clone and build inside that environment I’m almost certain it works because 1. I use that setup for my day to day work and 2. the CI of PX4 automatically builds every change that’s made this way. You don’t need to execute any of these python setup commands manually if you use this toolchain.

Can you provide more details on what exact steps you performed? What’s the exact output? Screenshot?
I need more data to find out what’s going wrong.