PIP install from local git repository

If you want to test a PIP package located in a local git repository you can do it this way:

pip install git+file:///path/to/your/git/repo

Or to checkout a specific branch just add @branch_name at the end:

pip install git+file:///path/to/your/git/repo@branch

Installing from a github repository

If you want to install a PIP package from a github repository use the following command:

pip install git+git://github.com/my_user/my_project 

Specific branch:

pip install git+git://github.com/my_user/my_project@my_branch

Installing from a Bitbucket repository

Using git+ssh:

pip install git+ssh://git@bitbucket.org/username/projectname.git

If you are using a different VCS please have a look at the PIP documentation.

Comments 1

  1. Thanks.
    What I am having difficulty in nailing down is what fder structure should the repo have? Should it be a wheel and if so how do I build the wheel such tbat it can be used as you have explained. I have done ample reading and have lots of the snippets but I am missing something and can’t seem to piece it all together.

    Would appreciate some clarity on that if you have the time

    Cheers

Leave a Reply

Your email address will not be published. Required fields are marked *