VCS Support

pip supports installing from various version control systems (VCS). This support requires a working executable to be available (for the version control system being used). It is used through URL prefixes:

  • Git -- git+

  • Mercurial -- hg+

  • Subversion -- svn+

  • Bazaar -- bzr+

Supported VCS


The supported schemes are git+file, git+https, git+ssh, git+http, git+git and git. Here are some of the supported forms:

MyProject @ git+ssh://
MyProject @ git+file:///home/user/projects/MyProject
MyProject @ git+


The use of git, git+git, and git+http schemes is discouraged. The former two use the Git Protocol, which lacks authentication, and HTTP is insecure due to lack of TLS based encryption.

It is also possible to specify a “git ref” such as branch name, a commit hash or a tag name:

MyProject @ git+
MyProject @ it+
MyProject @ git+
MyProject @ git+

When passing a commit hash, specifying a full hash is preferable to a partial hash because a full hash allows pip to operate more efficiently (e.g. by making fewer network calls).


The supported schemes are hg+file, hg+http, hg+https, hg+ssh and hg+static-http. Here are some of the supported forms:

MyProject @ hg+
MyProject @ hg+
MyProject @ hg+ssh://
MyProject @ hg+file:///home/user/projects/MyProject

It is also possible to specify a revision number, a revision hash, a tag name or a local branch name:

MyProject @ hg+
MyProject @ hg+
MyProject @ hg+
MyProject @ hg+


The supported schemes are svn, svn+svn, svn+http, svn+https and svn+ssh. Here are some of the supported forms:

MyProject @svn+
MyProject @svn+ssh://
MyProject @svn+ssh://

You can also give specific revisions to an SVN URL, like so:

MyProject @ -e svn+
MyProject @ -e svn+{20080101}

Note that you need to use Editable VCS installs for using specific revisions from Subversion.


The supported schemes are bzr+http, bzr+https, bzr+ssh, bzr+sftp, bzr+ftp and bzr+lp. Here are the supported forms:

MyProject @ bzr+
MyProject @ bzr+s
MyProject @ bzr+ssh://
MyProject @ bzr+
MyProject @ bzr+lp:MyProject

Tags or revisions can be installed like so:

MyProject @ bzr+
MyProject @ bzr+

Editable VCS installs

VCS projects can be installed in editable mode (using the --editable option) or not.

  • The default clone location (for editable installs) is:

    • <venv path>/src/SomeProject in virtual environments

    • <cwd>/src/SomeProject for global Python installs

    The --src option can be used to modify this location.

  • For non-editable installs, the project is built locally in a temp dir and then installed normally.

Note that if a satisfactory version of the package is already installed, the VCS source will not overwrite it without an --upgrade flag. Further, pip looks at the package version, at the target revision to determine what action to take on the VCS requirement (not the commit itself).

The pip freeze subcommand will record the VCS requirement specifier (referencing a specific commit) only if the install is done with the editable option.

URL fragments

pip looks at 2 fragments for VCS URLs:

  • egg: For specifying the “project name” for use in pip’s dependency resolution logic. eg: egg=project_name

  • subdirectory: For specifying the path to the Python package, when it is not in the root of the VCS directory. eg: pkg_dir


If your repository layout is:

├──  # for package "pkg"
└── some_file

Then, to install from this repository, the syntax would be:

$ python -m pip install -e "vcs+protocol://repo_url/#egg=pkg&subdirectory=pkg_dir"
$ python -m pip install -e "vcs+protocol://repo_url/#egg=pkg&subdirectory=pkg_dir"
C:> py -m pip install -e "vcs+protocol://repo_url/#egg=pkg&subdirectory=pkg_dir"