Problem in building ardupilot

I want to build the ardupilot using virtualenv
and I got this error
ERROR: Can not perform a ‘–user’ install. User site-packages are not visible in this virtualenv.

First, ArduPilot isn’t written in Python, so that makes no sense.

Second, the build environment does use Python tools, and (properly configured) it creates a venv for you. There’s no need to further encapsulate it.

Lastly, if you do want to segregate the build environment from the user a bit more, look into building with docker.

Thanks a lot Yuri

I also tried without env its shown below error

I am facing this error while building the ardupilot code

‘configure’ finished successfully (2.511s)
drone@drone-desktop:~/Desktop/ardupilot$ ./waf build
Waf: Entering directory `/home/drone/Desktop/ardupilot/build/sitl’
Embedding file locations.txt:Tools/autotest/locations.txt
Embedding file models/Callisto.json:Tools/autotest/models/Callisto.json
Embedding file models/plane-3d.parm:Tools/autotest/models/plane-3d.parm
Embedding file models/plane.parm:Tools/autotest/models/plane.parm
Embedding file models/xplane_heli.json:Tools/autotest/models/xplane_heli.json
Embedding file models/xplane_plane.json:Tools/autotest/models/xplane_plane.json
[ 579/2777] Compiling modules/DroneCAN/libcanard/canard.c
[ 888/2777] Compiling libraries/AP_Logger/AP_Logger_Backend.cpp
[ 891/2777] Compiling libraries/GCS_MAVLink/GCS_Dummy.cpp
[ 892/2777] Compiling libraries/GCS_MAVLink/GCS_Common.cpp
[ 893/2777] Compiling libraries/RC_Channel/RC_Channel.cpp
[ 894/2777] Compiling libraries/StorageManager/StorageManager.cpp
…/…/libraries/AP_Logger/AP_Logger_Backend.cpp: In member function ‘bool AP_Logger_Backend::Write_VER()’:
…/…/libraries/AP_Logger/AP_Logger_Backend.cpp:577:5: sorry, unimplemented: non-trivial designated initializers not supported
};
^
compilation terminated due to -Wfatal-errors.

Waf: Leaving directory `/home/drone/Desktop/ardupilot/build/sitl’
Build failed
→ task in ‘objs/AP_Logger/ArduCopter’ failed (exit status 1):
{task 548425956264: cxx AP_Logger_Backend.cpp → AP_Logger_Backend.cpp.3.o}
(run with -v to display more information)

Likely a toolchain issue - maybe C++ version incompatibility. What instructions are you following? Why are you trying to build the entire project rather than a target vehicle type?

I tried for copter also but it also shows exactly the same error.
I’m trying on Jetson nano Developer kit.

It also showed a below error during installing Tools/environment_install/install-prereqs-ubuntu.sh -y but later on it it completed successfully.

importlib-metadata, pygame, pexpect, MAVProxy, intelhex, geocoder, flake8, empy, dronecan
WARNING: The script pyflakes is installed in ‘/home/drone/.local/bin’ which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The script pycodestyle is installed in ‘/home/drone/.local/bin’ which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Attempting uninstall: importlib-metadata
Found existing installation: importlib-metadata 4.8.3
Uninstalling importlib-metadata-4.8.3:
Successfully uninstalled importlib-metadata-4.8.3
WARNING: The script geocode is installed in ‘/home/drone/.local/bin’ which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

Steps that I’m following:

  1. git clone GitHub - ArduPilot/ardupilot: ArduPlane, ArduCopter, ArduRover, ArduSub source --recursive
  2. cd ardupilot
  3. Tools/environment_install/install-prereqs-ubuntu.sh -y
  4. . ~/.profile
  5. ./waf configure
  6. ./waf build
    or ./waf copter

Dear Vipul-2
I have also face a error just like your.
So do you have sovle this problem?

You should follow each and every step that is relevant to your setup, as described here.
There are instructions for different OS types and environments.

Install all prerequisites, clone repo, update module, configure waf and then build.