PX4 Ubuntu 16.04 compiles problem

I followed the instructions at px4 wiki.
When I was going to compile it, it shows the errors, and I was trying to fix them by using pip install. But it still shows no module named ‘packaging’.

huang@huang-Lenovo-Gaming:~/src/Firmware$ make px4_fmu-v2_default
[2/725] git submodule src/drivers/gps/devices
[9/725] git submodule mavlink/include/mavlink/v2.0
[9/725] Generating uORB topic headers
FAILED: cd /home/huang/src/Firmware/msg && /usr/bin/python3 tools/px_generate_uorb_topic_files.py --headers -f actuator_armed.msg actuator_controls.msg actuator_outputs.msg adc_report.msg airspeed.msg airspeed_validated.msg battery_status.msg camera_capture.msg camera_trigger.msg cellular_status.msg collision_constraints.msg collision_report.msg commander_state.msg cpuload.msg debug_array.msg debug_key_value.msg debug_value.msg debug_vect.msg differential_pressure.msg distance_sensor.msg ekf2_timestamps.msg ekf_gps_drift.msg ekf_gps_position.msg esc_report.msg esc_status.msg estimator_innovations.msg estimator_sensor_bias.msg estimator_status.msg follow_target.msg geofence_result.msg gps_dump.msg gps_inject_data.msg home_position.msg hover_thrust_estimate.msg input_rc.msg iridiumsbd_status.msg irlock_report.msg landing_gear.msg landing_target_innovations.msg landing_target_pose.msg led_control.msg log_message.msg logger_status.msg manual_control_setpoint.msg mavlink_log.msg mission.msg mission_result.msg mount_orientation.msg multirotor_motor_limits.msg obstacle_distance.msg offboard_control_mode.msg onboard_computer_status.msg optical_flow.msg orb_test.msg orb_test_large.msg orb_test_medium.msg orbit_status.msg parameter_update.msg ping.msg position_controller_landing_status.msg position_controller_status.msg position_setpoint.msg position_setpoint_triplet.msg power_button_state.msg power_monitor.msg pwm_input.msg qshell_req.msg qshell_retval.msg radio_status.msg rate_ctrl_status.msg rc_channels.msg rc_parameter_map.msg rpm.msg safety.msg satellite_info.msg sensor_accel.msg sensor_accel_fifo.msg sensor_accel_integrated.msg sensor_accel_status.msg sensor_baro.msg sensor_combined.msg sensor_correction.msg sensor_gyro.msg sensor_gyro_fifo.msg sensor_gyro_integrated.msg sensor_gyro_status.msg sensor_mag.msg sensor_preflight.msg sensor_selection.msg servorail_status.msg subsystem_info.msg system_power.msg task_stack_info.msg tecs_status.msg telemetry_status.msg test_motor.msg timesync.msg timesync_status.msg trajectory_bezier.msg trajectory_waypoint.msg transponder_report.msg tune_control.msg uavcan_parameter_request.msg uavcan_parameter_value.msg ulog_stream.msg ulog_stream_ack.msg vehicle_acceleration.msg vehicle_air_data.msg vehicle_angular_acceleration.msg vehicle_angular_velocity.msg vehicle_attitude.msg vehicle_attitude_setpoint.msg vehicle_command.msg vehicle_command_ack.msg vehicle_constraints.msg vehicle_control_mode.msg vehicle_global_position.msg vehicle_gps_position.msg vehicle_imu.msg vehicle_land_detected.msg vehicle_local_position.msg vehicle_local_position_setpoint.msg vehicle_magnetometer.msg vehicle_odometry.msg vehicle_rates_setpoint.msg vehicle_roi.msg vehicle_status.msg vehicle_status_flags.msg vehicle_trajectory_bezier.msg vehicle_trajectory_waypoint.msg vtol_vehicle_status.msg wheel_encoders.msg wind_estimate.msg yaw_estimator_status.msg -i /home/huang/src/Firmware/msg -o /home/huang/src/Firmware/build/px4_fmu-v2_default/uORB/topics -e templates/uorb -t /home/huang/src/Firmware/build/px4_fmu-v2_default/msg/tmp/headers -q --constrained-flash
Traceback (most recent call last):
  File "tools/px_generate_uorb_topic_files.py", line 46, in <module>
    from packaging import version
ImportError: No module named 'packaging'
[9/725] Performing configure step for 'px4io_firmware'
-- PX4 version: v1.11.0-beta1-1105-geb1bad0
-- PX4 config file: /home/huang/src/Firmware/boards/px4/io-v2/default.cmake
-- PX4 config: px4_io-v2_default
-- PX4 platform: nuttx
-- cmake build type: MinSizeRel
-- The CXX compiler identification is GNU 6.3.1
-- The C compiler identification is GNU 6.3.1
-- The ASM compiler identification is GNU
-- Found assembler: /usr/lib/ccache/arm-none-eabi-gcc
-- Check for working CXX compiler using: Ninja
-- Check for working CXX compiler using: Ninja -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler using: Ninja
-- Check for working C compiler using: Ninja -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- ccache enabled via symlink (/usr/lib/ccache/arm-none-eabi-g++ -> /usr/bin/ccache)
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.5.2", minimum required is "3") 
-- build type is MinSizeRel
-- PX4 ECL: Very lightweight Estimation & Control Library v1.9.0-rc1-244-g870ec38
-- Configuring done
-- Generating done
-- Build files have been written to: /home/huang/src/Firmware/build/px4_fmu-v2_default/external/Build/px4io_firmware
ninja: build stopped: subcommand failed.
Makefile:198: recipe for target 'px4_fmu-v2_default' failed
make: *** [px4_fmu-v2_default] Error 1

The minimum required version to build PX4 is Ubuntu 18.04, here’s the link to the documentation Ubuntu Development Environment | PX4 User Guide

1 Like