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

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

我正在尝试将 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

正如the docs所说:

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.

因此,如果您的 %PATH% 上没有有效的 git 命令,您就不能 pip install git+<anything>。要修复它,install git,并确保它最终出现在您的 %PATH%.