Set Up Issue Even After Installing Behave Command

Modified on Mon, 1 Jul at 10:58 AM

'Behave Command Not Found' Error

Issue: When running Python Selenium or Python Appium scripts for web or mobile automation (both for mobile applications and mobile websites) on Mac machines, if you see this 'Behave Command Not Found' even after installing all the required packages, then perform the following as provided in the resolution column.



  Resolution 
  1. To run the nano ~/.zshrccommand on a Mac:
    1. Open Terminal:

      You can launch Terminal by navigating to the "Applications" folder, then to the "Utilities" folder, and finally clicking on "Terminal." Alternatively, you can use Spotlight search (Cmd + Space) and type "Terminal" to find and open it.

    2. Enter Command:
      Once Terminal is open, type nano ~/.zshrc and press Enter. This command opens the Zsh profile file ~/.zshrc in the Nano text editor. If the file doesn't exist, Nano creates a new one. The ~ symbol represents your home directory.

  2. Update Python Binary Path:
    1. Locate the line starting with "export PATH=" within the ~/.zshrc file.

    2. Add your Python binary path to this line in the following format:
      export PATH="/path/to/your/python/bin:$PATH"Replace "/path/to/your/python/bin" with the actual path to your Python binary directory.


    3. Save Changes and Exit 

      Press Ctrl + O to save the changes.

      Press Ctrl + X to exit the Nano text editor.

    4. Close and Reopen Terminal:
      Close all Terminal windows.
      Open a new Terminal window by using Spotlight search (Cmd +space) if needed to ensure that the changes are reflected.

  3. To verify if the path is configured, run the following command in the  new Terminal window: 
    source ~/.zshrcPress Enter to apply the changes.

  4. To verify that the path is configured correctly, type:

    echo $PATH

    Ensure that your Python binary path is included in the output.

  5. Confirm Behave Installation:

    To check if Behave is installed and accessible, type:

     behave --version


    Press Enter to view the Behave version. If installed correctly, it must display the version number.


















Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article