Python 如何从github pip install ....powershell 给出错误找不到命令'git'?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29957484/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 05:13:08  来源:igfitidea点击:

How to pip install from github....powershell gives error Cannot find command 'git'?

pythonpowershellpipvirtualenvpsycopg2

提问by Groovietunes

I'm trying install psycopg2 into my virtualenv. I've tried pip I've tried easy_install nothing is working... installing from pip is the more desirable choice but it has to be done through nwcell's github package https://github.com/nwcell/psycopg2-windowsheres the command I've been using:

我正在尝试将 psycopg2 安装到我的 virtualenv 中。我试过 pip 我试过 easy_install 没有任何效果...从 pip 安装是更理想的选择,但它必须通过 nwcell 的 github 包 https://github.com/nwcell/psycopg2-windows这里的命令来完成我一直在使用:

pip install git+https://github.com/nwcell/psycopg2-windows.git@win64-py34#egg=psycopg2

采纳答案by abarnert

As the docssay:

正如文档所说:

pip supports installing from Git, Mercurial, Subversion and Bazaar, and detects the type of VCS using url prefixes: "git+", "hg+", "bzr+", "svn+".

pip requires a working VCS command on your path: git, hg, svn, or bzr.

pip 支持从 Git、Mercurial、Subversion 和 Bazaar 安装,并使用 url 前缀检测 VCS 的类型:“git+”、“hg+”、“bzr+”、“svn+”。

pip 需要在您的路径上使用有效的 VCS 命令:git、hg、svn 或 bzr。

So, if you don't have a working gitcommand on your %PATH%, you can't pip install git+<anything>. To fix it, install git, and make sure it ends up on your %PATH%.

所以,如果你没有工作做git在你的命令%PATH%,你不能pip install git+<anything>。要修复它,请安装git,并确保它最终出现在您的%PATH%.