Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I install a package from Bitbucket using pip?

Tags:

I'm making a setup.py that needs to point to my repository.

with github i can do this:

dependency_links=['https://github.com/nathanborror/django-registration/tarball/master#egg=django-registration'] 

how can I do the same with a bitbucket project ?

for example this url:

https://bitbucket.org/abraneo/django-registration 

Thanks.

like image 514
Bengineer Avatar asked Apr 24 '12 16:04

Bengineer


People also ask

What is pip install []?

pip is a standard package manager used to install and maintain packages for Python. The Python standard library comes with a collection of built-in functions and built-in packages. Data science packages like scikit-learn and statsmodel are NOT part of the Python standard library.

Can you pip install Git?

You can deploy Git locally, or use it via a hosted service, such as Github, Gitlab or Bitbucket. One of the advantages of using pip together with Git is to install the latest commits of unreleased Python packages as branches from Github.

Can pip install local packages?

Install the downloaded package into a local directory : python get-pip.py --user This will install pip to your local directory (. local/bin) . Now you may navigate to this directory (cd . local/bin) and then use pip or better set your $PATH variable this directory to use pip anywhere : PATH=$PATH:~/.


2 Answers

Your Github link looks to be pointing to a gzipped tar file. Try doing the same for your Bitbucket hosted project -- https://bitbucket.org/abraneo/django-registration/get/tip.tar.gz

like image 120
James Sumners Avatar answered Feb 28 '23 00:02

James Sumners


A BitBucket Mercurial (hg) repository can be added with the following URL in dependency_links:

'https://bitbucket.org/zzzeek/alembic/get/tip.zip#egg=alembic-0.6.0' 

In this case it installs the development version (0.6) of the Alembic package, which is not yet in PyPI at the time of writing.

Note that BitBucket supports both Mercurial and git. if the repo is Mercurial, the URL must reference tip.zip, but if it's git, the URL must reference master.zip.

like image 22
glyphobet Avatar answered Feb 28 '23 02:02

glyphobet