34

I'm trying to install a package from Github, using Pip, using the following syntax

pip install -e git+https://github.com/facebook/python-sdk.git#egg=FacebookSDK

and getting the error "cannot find command git". This Question has (unchecked) answers saying that Git needs to be installed on the system. However, this Answer states that "Git, Subversion, Bazaar and Mercurial are all supported" by Pip.

The Pip documentation also says it has "Native support for other version control systems (Git, Mercurial and Bazaar)".

So how do I install this package with Pip? I really don't want to install Git on my VPS. Or are there any non-Pip tools, for just pulling files from repositories (without doing a full Git install)?

Update - so I bit the bullet, and installed Git on my VPS. Pip still wasn't able to grab the package, but it was giving a different set of errors, so - progress. :) I finally did

git clone http://github.com/facebook/python-sdk.git

(note the http, not https), and manage to download the package, then just installed it manually.

3
  • 2
    Although pip 'supports git', it still needs the git client/programme in order to fetch the files. Commented Apr 7, 2012 at 13:07
  • see this answer about bypassing git altogether by using the "download everything in a zipfile" option, pip install https://github.com/example/some-cool-project/zipball/master Commented Dec 4, 2013 at 21:32
  • 3
    Dunno who decided that "this question may already have an answer here", or that this is a duplicate question - but the other question was asked two months after mine. Wouldn't that make it the duplicate?
    – John C
    Commented Dec 20, 2013 at 13:10

4 Answers 4

50

If I'm not mistaken, you would need the git client to be install on your machine. In the event that you don't have git installed, try this:

pip install https://github.com/facebook/python-sdk/zipball/master

or

pip install https://github.com/facebook/python-sdk/tarball/master

You need to install the git-core, since the git:// protocol isn't associated with anything.

sudo apt-get install git-core
7
  • Using https only, didn't work. Also, why would I need to install the Git client? The docs state that it's a supported repository format.
    – John C
    Commented Sep 6, 2011 at 15:43
  • I ran the same and got it to work. I'm not too sure of the underlying reason. I'm fairly confident that you would need git because git:// isn't associated with anything. Have a look at stackoverflow.com/questions/3610639/… Commented Sep 6, 2011 at 15:48
  • I did already look at that link, it's the same one I linked - and none of the answers have a checkmark, or even upvotes. Plus, they contradict the documentation. Granted, it's possible the docs are wrong.
    – John C
    Commented Sep 6, 2011 at 15:50
  • Yup, I noticed the same. I think what they meant to say is that it uses the git tool to fetch the source. Have the look their Git implementation: bitbucket.org/ianb/pip/src/c036c41fce72/pip/vcs/git.py. I don't see anything resembling a git protocol implementation to pull the sources. HTH. Commented Sep 6, 2011 at 15:59
  • 2
    Written wrong / reading it wrong = all the same in this case since it doesn't work without the git-core or using a simple http connection. I've edited my answer reflect our conversation in the comments. Cheers! Commented Sep 6, 2011 at 16:13
6

For Windows or none git users:

  1. I first download and unpack the file.

  2. Then in the python directory going to \Scripts

  3. Starting here the command prompt (shift + rigth-click)

  4. pip install C:\Theano-master *# replace Theano-master with the path to your directory of your package

1
  • 1
    I would just mention to replace the C:\Theano-master with the filepath location of the module.
    – BCR
    Commented Aug 31, 2015 at 20:06
1

This morning, when I run python pip to install a pcakge from git has problems.
pip install git+https://github.com/gumblex/zhconv.git#egg=zhconv
Firstly get error msg:
ERROR: Cannot find command 'git' - do you have 'git' installed and in your PATH?

Try pip install git

ERROR: Could not find a version that satisfies the requirement git
ERROR: No matching distribution found for git

When I find this question,tried answers from @Mridang Agarwalla not work for first one; for second cmd, there was "time out" to git site.

But when trying answer from @Martijn van Wezel, it is very successfully. Thanks! @Martijn van Wezel

My trying is:

  1. download the Zip file i need from Git page and extract it to a folder.
    https://github.com/gumblex/zhconv
    extract the ZIP to my local folder: D:\gitPackageforinstall\zhconv
  2. Then success by below cmd. pip install D:\gitPackageforinstall\zhconv

Hope this could be a reference to others as an update for 20210419

-3

I'm learning about PostgreSQL and had to install the windows version. It was suggested to use git+, and I was running to the same issues that John C was experiencing.

Martijn above recommended unpacking and downloading. That is also what the creators of win-psycopg suggested. So I thought I'd share their method for installing into a Virtual Environment.

Thank you stickpeople: http://www.stickpeople.com/projects/python/win-psycopg/

To install into a virtual env: Pretty neat

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.