zsh:找不到命令:启动Django项目时为django-admin [英] zsh: command not found: django-admin when starting a django project

查看:1118
本文介绍了zsh:找不到命令:启动Django项目时为django-admin的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Ubuntu 15.10和zsh(不知道是否可以提供帮助)
所以我尝试安装django:

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...

一切正常.当我执行pip freeze时,我可以看到django已安装.

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

然后: django-admin startproject mysite

但是我遇到了这个问题:
zsh: command not found: django-admin

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

推荐答案

我找到了替代解决方案. 使用find / -name django-admin我在myHome/.local/bin/django-admin中找到了django-admin.

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

因此,我使用的是完整路径myHome/.local/bin/django-admin startproject mysite

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

感谢@Evert,这就是我遇到问题的原因. 他的评论:

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.

这篇关于zsh:找不到命令:启动Django项目时为django-admin的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆