pythondjangopipubuntu-15.10

zsh: command not found: django-admin when starting a django project


I use Ubuntu 15.10 and zsh (don't know if it can help)
So I try to install django:

pip install django
Downloading/unpacking django
  Downloading Django-1.9.5-py2.py3-none-any.whl (6.6MB): 6.6MB downloaded
Installing collected packages: django
Successfully installed django
Cleaning up...

Everything works fine. When I do pip freeze I can see django is installed.

then: django-admin startproject mysite

But I got this issue:
zsh: command not found: django-admin


Solution

  • I found an alternative solution. With find / -name django-admin I found django-admin in myHome/.local/bin/django-admin.

    So instead of django-admin startproject mysite I use the full path myHome/.local/bin/django-admin startproject mysite

    thanks to @Evert, this is why I got the problem.
    his comment:

    This is likely because you either used the --user option to pip 
    install, or you set up pip in such a way that it automatically does 
    that. Hence, everything gets installed in $HOME/.local. You may want
    to add $HOME/.local/bin to your $PATH for the future.