ansible-inventory-grapher: command not found

Have You tried accessing the binary with the full path?

Maybe Your $PATH variable doesn't contain the default paths? echo $PATH should give something like:

[root@server ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

If it's empty, You may set the PATH variable with this command

export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"

On CentOS possible default full paths are:

/usr/bin/ansible-inventory-grapher - from package: ansible-inventory-grapher

You may install the required package with command yum install {package}
Error in other languages:
ansible-inventory-grapher: bevel nie gevind nie
ansible-inventory-grapher: comandă negăsită
ansible-inventory-grapher: comando não encontrado
ansible-inventory-grapher: commande introuvable
ansible-inventory-grapher: command not found
ansible-inventory-grapher: käsku ei ole
ansible-inventory-grapher: không tìm thấy lệnh
ansible-inventory-grapher: komanda nerasta
ansible-inventory-grapher: Kommando nicht gefunden.
ansible-inventory-grapher: kommandot finns inte
ansible-inventory-grapher: komut yok
ansible-inventory-grapher: nie znaleziono polecenia
ansible-inventory-grapher: níor aimsíodh an t-ordú
ansible-inventory-grapher: no se encontró la orden
ansible-inventory-grapher: no s'ha trobat l'ordre
ansible-inventory-grapher: opdracht niet gevonden
ansible-inventory-grapher: parancs nem található
ansible-inventory-grapher: perintah tidak ditemukan
ansible-inventory-grapher: príkaz nenájdený
ansible-inventory-grapher: příkaz nenalezen
ansible-inventory-grapher: команда не найдена
ansible-inventory-grapher: командата не е открита
ansible-inventory-grapher: 命令找不到
ansible-inventory-grapher: コマンドが見つかりません