【问题标题】:Error With Git Tab Completion: "python: can't open file 'manage.py': [Errno 2]"Git选项卡完成时出错:“python:无法打开文件'manage.py':[Errno 2]”
【发布时间】:2013-08-22 13:59:42
【问题描述】:

当我尝试使用 tab 完成 git 命令时,我收到了这个 python 错误。有时,它仍然会完成命令(但在 3 行 Python 错误之后),有时它会执行以下操作。 Git 和 bash-completion 是最新版本。我正在运行 Ubuntu 13.04。我怎样才能摆脱这个错误?

[~/code]$ git co[TAB]python: can't open file 'manage.py': [Errno 2] No such file or directory
python: can't open file 'manage.py': [Errno 2] No such file or directory
python: can't open file 'manage.py': [Errno 2] No such file or directory
^C

[~/code]$ sudo apt-get install bash-completion
Reading package lists... Done
Building dependency tree       
Reading state information... Done
bash-completion is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

[~/code]$ sudo apt-get install git
Reading package lists... Done
Building dependency tree       
Reading state information... Done
git is already the newest version.
git set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

【问题讨论】:

    标签: python git bash shell autocomplete


    【解决方案1】:

    manage.py 来自 Django,而不是 git。听起来你已经安装了 Django bash 补全,但没有安装 Django 本身(或者它可能在你没有激活的 virtualenv 中)。

    【讨论】:

    • 如何禁用 Django bash 补全?为什么它在没有 Django 项目的文件夹中运行?我确实安装了 Django。
    猜你喜欢
    • 1970-01-01
    • 2019-10-24
    • 2017-12-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多