Zsh: command not found: django-admin

The error message “zsh: command not found: django-admin” indicates that the django-admin command is not recognized by your shell (zsh). This means that either Django is not installed or the django-admin command is not in your system’s PATH variable.

To resolve this issue, you need to ensure that Django is properly installed and the django-admin command is accessible.

1. Verify Django Installation

Open a terminal and execute the following command to check if Django is installed:

        $ python -m django --version
    

If Django is not installed, you can install it using pip:

        $ pip install django
    

2. Add Django to PATH

If Django is installed but the django-admin command is still not found, you may need to manually add Django to your system’s PATH variable.

Find the path to the Django package by executing the following command in the terminal:

        $ python -c "import django; print(django.__path__[0])"
    

Copy the output path and add it to your PATH variable. Here is an example of how to add it on Linux/macOS:

        $ export PATH=$PATH:/path/to/django
    

After adding Django to your PATH, try running the django-admin command again. It should now be recognized by your shell.

Similar post

Leave a comment