django-admin.py: command not found (bluehost server)(django-admin.py:找不到命令(bluehost 服务器))
问题描述
挣扎了6个多小时后,我决定寻求帮助.
After struggling more than 6 hours, I decided to ask for help.
使命:在Django的帮助下创建一个项目
工具:Windows Vista、Putty SSH
位置:Bluehost (www.bluehost.com) 服务器
Mission: To create a project with the help of Django
Tools: Windows Vista, Putty SSH
Location: Bluehost (www.bluehost.com) Server
我已经阅读过关于同一个问题的这些主题:
- -bash: django-admin.py: 命令不找到(Django 安装)
- 无法使用django-admin.py
- Django:当新建项目,django-admin.py: command not found" 弹出错误
- django-admin.py:找不到命令
- 找不到命令:django-admin.py
- Django-admin.py 不工作(-bash:django-admin.py: 找不到命令)
我已按照此处的说明(Bluehost 帮助页面)安装了 Python:
https://my.bluehost.com/cgi/help/python-install
I have installed Python as explained here (Bluehost Help Page):
https://my.bluehost.com/cgi/help/python-install
username@domain.com [~/python]# ls
./ ../ Python-2.7.2/ Python-2.7.2.tgz bin/ include/ lib/ share/
目录~/python/Python-2.7.2/如下所示:
username@domain.com [~/python/Python-2.7.2]# ls
./ LICENSE Objects/ build/ pyconfig.h.in
../ Lib/ PC/ config.log python*
.hg_archival.txt Mac/ PCbuild/ config.status* python-gdb.py
.hgtags Makefile Parser/ configure* setup.py
Demo/ Makefile.pre Python/ configure.in
Doc/ Makefile.pre.in README install-sh*
Grammar/ Misc/ RISCOS/ libpython2.7.a
Include/ Modules/ Tools/ pyconfig.h
和 ~/python/bin/ 看起来像这样:
username@domain.com [~/python/bin]# ls
./ 2to3* idle* python* python2.7* smtpd.py*
../ django-admin.py* pydoc* python-config@ python2.7-config*
安装并检查了Django 1.5,它看起来像:
username@domain.com [~/Django-1.5]# ls
./ AUTHORS LICENSE PKG-INFO build/ docs/ scripts/ setup.py
../ INSTALL MANIFEST.in README.rst django/ extras/ setup.cfg tests/
和 ~/Django-1.5/bin/ 看起来像这样:
username@domain.com [~/Django-1.5/django/bin]# ls
./ __init__.py django-2to3.py* profiling/
../ daily_cleanup.py* django-admin.py* unique-messages.py*
问题:当我尝试创建我的项目时,我看到了这个错误:
username@domain.com [~/www/domain/]# django-admin.py startproject mysite
-bash: django-admin.py: command not found
然后我在没有.py的情况下再次尝试,我看到了这个错误:
Then I have tried again without .py, I see this error:
username@domain.com [~/www/domain/]# django-admin.py startproject mysite
-bash: django-admin.py: command not found
~/.bashrc 看起来像这样:
# .bashrc
export PATH=$HOME/.local/bin:$HOME/.local/usr/bin:$PATH
#User specific aliases and functions
alias mv='mv -i'
alias rm='rm -i'
alias cp='cp -i'
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
~
~
~/bin/看起来像这样:
username@domain.com [~/bin]# ls
./ ../
所以我阅读了很多关于 PATH 的内容,但我无法让它发挥作用.我应该放弃吗?
So I read a lot about the PATH, but I could not make it work. Should I give up?
推荐答案
修改你的 .bashrc
PATH 条目,如下所示:
Modify your .bashrc
PATH entry to look like:
export PATH=$HOME/Django-1.5/bin/:$HOME/.local/bin:$HOME/.local/usr/bin:$PATH
然后通过执行以下操作重新加载您的 .bashrc
:
And reload your .bashrc
by doing:
# . ~/.bashrc
这篇关于django-admin.py:找不到命令(bluehost 服务器)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:django-admin.py:找不到命令(bluehost 服务器)
基础教程推荐
- 使用 Google App Engine (Python) 将文件上传到 Google Cloud Storage 2022-01-01
- 使 Python 脚本在 Windows 上运行而不指定“.py";延期 2022-01-01
- 如何在 Python 中检测文件是否为二进制(非文本)文 2022-01-01
- 合并具有多索引的两个数据帧 2022-01-01
- 如何在Python中绘制多元函数? 2022-01-01
- Python 的 List 是如何实现的? 2022-01-01
- 使用Python匹配Stata加权xtil命令的确定方法? 2022-01-01
- 将 YAML 文件转换为 python dict 2022-01-01
- 症状类型错误:无法确定关系的真值 2022-01-01
- 哪些 Python 包提供独立的事件系统? 2022-01-01