• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

Roger Perkin

Network Automation Architect

  • Network Automation
    • Network Automation Courses
    • What is NetDevOps?
    • Workflow Orchestration
    • Ansible Automation Platform
    • Ansible Workshop
    • What is Network Automation?
    • Network Automation Tools
    • ContainerLab
    • Ansible Training
      • What is Ansible?
      • Ansible Tutorial for Beginners
      • Ansible Network Automation
      • Ansible Inventory Example
    • Python Network Automation
      • Nornir
      • Python Network Automation Course
      • Python for Network Engineers
      • Python VENV / Virtual Environment Tutorial
      • Python Tutorial for Beginners
      • pyATS
    • Network Source of Truth
      • NetBox
      • Infrahub
    • NetDevops
    • DevOps Tutorial
      • Git Training
      • Terraform Training
      • Linux Training
      • Kubernetes Training
      • Devops Training Course
      • Azure Devops Training
    • Terraform
    • GIT
      • Git Commands
      • What is GitHub?
    • Docker Training
    • Confluence
    • Microsoft Azure
  • Cisco
    • ISE
    • SD WAN Training
    • Password Recovery
    • Software-Upgrade-Guides
    • BGP
    • Data Center
    • WIRELESS
  • CCIE
  • Blog
  • About
    • My Red Special Guitar
  • Contact

ZSH: command not found: Ansible

Home » Network Automation » Ansible

If you have installed Ansible and are using ZSH and when you run ansible –version you get command not found Ansible – this was my fix

zsh command not found ansible

When you install ZSH some path variables are changed and in your home directory a file called .zshrc is created.

You need to make sure that the directory that Ansible is installed is in your PATH

I am running Ubuntu 22 and Ansible latest version 2.13.4

I uninstalled Ansible first

pip3 uninstall Ansible 

Then I re-installed Ansible

python3 -m pip install --user ansible

Then I edit the .zshrc file in my home directory and add the code below, you might have something there already.

export PATH=$HOME/bin:/usr/local/bin:$HOME/.local/bin:$HOME/.local/bin:$PATH

The part that was missing for me was /usr/local/bin the separate parts are separated by :

Then I restart my terminal and voila!

➜  ~ ansible --version 
ansible [core 2.13.4]
  config file = None
  configured module search path = ['/home/roger/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/roger/.local/lib/python3.10/site-packages/ansible
  ansible collection location = /home/roger/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/roger/.local/bin/ansible
  python version = 3.10.6 (main, Aug 10 2022, 11:40:04) [GCC 11.3.0]
  jinja version = 3.1.2
  libyaml = True
Category: Ansible Network Automation
ansible course for network engineers
Get Access to my Ansible Course NOW
Previous Post:Secure data transfer in automation processes
Next Post:What is NetDevOps? Network Automation + DevOpsnetwork devops

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Sidebar

Hi I'm Roger Perkin,
Based in the UK working as a Network Automation Architect, CCIE #50038
About Roger | Twitter | Linkedin

python course for network engineers

More Ansible

  • What is Ansible?
  • AWX
  • Ansible Template Module
  • Ansible Vault Tutorial
  • Ansible vs Python Scripts
  • Advantages of Ansible Roles
  • Ansible Hosts File Tutorial
  • How to install Ansible Tower
  • Ansible Training
  • Ansible Cisco IOS Command
  • Use Ansible to Backup Cisco Config
  • Where are Ansible Modules Stored?
  • AnsibleFest London Review

Topics

Network Automation
Ansible
Python for Network Automation
CCIE
Cisco ISE
F5 Certification
BGP
OSPF
Network Automation Conferences
auvik promo banner
Pluralsight Trial

Git for Network Engineers

Ansible vs Nornir

Start learning today with my Network Automation Courses

Master Ansible, Python, Git, Nornir, Jenkins and more..


Buy me a coffeeBuy me a coffee

ansible network automation course

Have you seen my YouTube Channel?

YouTube Subscribe

Let’s get started

Take a look at my premium courses on Ansible, Nornir & Git or buy them all with the Network Automation Bundle!

Network Automation Courses

Navigation

Python VENV Tutorial
Python for Network Engineers

Network Automation
Network Automation Courses
Network Discovery Tools
Network Automation Conferences
Ansible Training
What is Ansible?
Devops Tutorial
Network Source of Truth
DevOps Glossary
Network Monitoring Software

Contact

Contact

Get in touch with me here

[email protected]

  • Twitter
  • LinkedIn
  • YouTube
Buy me a coffeeBuy me a coffee

Copyright © 2025 · Roger Perkin · All Rights Reserved · Privacy Policy – Terms