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
Answer from Mridang Agarwalla on Stack Overflow
» pip install github
How to use Python Pip install software, to pull packages from Github? - Stack Overflow
Using pip install from git as a substitute for private package repo
PIP Installing from Github
python - pip install from git repo branch - Stack Overflow
Videos
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
For Windows or none git users:
I first download and unpack the file.
Then in the python directory going to \Scripts
Starting here the command prompt (shift + rigth-click)
pip install C:\Theano-master*# replace Theano-master with the path to your directory of your package
» pip install PyGithub
At work, I have a Python package that I need to use elsewhere (on Databricks/Spark), but I don't really want to upload to PyPi, nor do I want the additional overhead of maintaining a private package repository (we're a small team, and the lightest-touch solution is usually preferable).
I know I can install packages from git, using the syntax:pip install git+https://github.com/some_user/some_repo@TAG
This works in the context that I need it, but I'm curious as to understand:
-
Is reasonable practice for managing dependencies, privately?
-
What are the drawbacks of doing it this way (versus a dedicated package repository)?
-
Are there any alternatives I'm not considering?
Grateful for any help :)
» pip install GitPython
Prepend the url prefix git+ (See VCS Support):
pip install git+https://github.com/tangentlabs/django-oscar-paypal.git@issue/34/oscar-0.6
And specify the branch name without the leading /.
Using pip with git+ to clone a repository can be extremely slow (test with https://github.com/django/django@stable/1.6.x for example, it will take a few minutes). The fastest thing I've found, which works with GitHub and BitBucket, is:
pip install https://github.com/user/repository/archive/branch.zip
which becomes for Django master:
pip install https://github.com/django/django/archive/master.zip
for Django stable/1.7.x:
pip install https://github.com/django/django/archive/stable/1.7.x.zip
With BitBucket it's about the same predictable pattern:
pip install https://bitbucket.org/izi/django-admin-tools/get/default.zip
Here, the master branch is generally named default.
This will make your requirements.txt installing much faster.
Some other answers mention variations required when placing the package to be installed into your requirements.txt. Note that with this archive syntax, the leading -e and trailing #egg=blah-blah are not required, and you can just simply paste the URL, so your requirements.txt looks like:
https://github.com/user/repository/archive/branch.zip
I want to install a package from github with pip. However, I have found several different ways to do it.
Option 1
$ pip install https://github.com/django-extensions/django-extensions/zipball/master $ pip freeze --local django-extensions==1.3.9
Option 2
$ pip install git+https://github.com/django-extensions/django-extensions $ pip freeze --local django-extensions==1.4.0
Option 2b
$ pip install git+https://github.com/django-extensions/django-extensions.git $ pip freeze --local django-extensions==1.4.0
Notice the .git suffix at the end of the pip install... line. It was missing in the previous case.
Option 3
$ pip install -e git+https://github.com/django-extensions/django-extensions.git#egg=django-extensions $ pip freeze --local -e git+https://github.com/django-extensions/django-extensions.git@4034b96b1879a14af3c26872e739abcad3fc4f3d#egg=django_extensions-master
Which is the preferred way? Option 1 installed an older version than Option 2. Option 3 seems to install the latest patch too? What's the difference?
Also, if I create a requirements.txt file, I want people to install the same version that I tested my software with. Although in Option 1 and 2 I install from GitHub, it's not reflected in the requirements.txt file, so if they execute pip install -r requirements.txt, the software will be pulled from PyPi. However, in Option 3 it will be pulled from GitHub.
Edit: section titles are in bold.
You need to use the proper git URL:
pip install git+https://github.com/jkbr/httpie.git#egg=httpie
Also see the VCS Support section of the pip documentation.
Don’t forget to include the egg=<projectname> part to explicitly name the project; this way pip can track metadata for it without having to have run the setup.py script.
To install Python package from github, you need to clone that repository.
git clone https://github.com/jkbr/httpie.git
Then just run the setup.py file from that directory,
sudo python setup.py install