Skip to content

Added installing on OS X #448

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 12, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,32 @@ from a bash shell:
At this point, you're ready to execute the generic pygit2 installation
steps described above.


Installing on OS X
===================================

.. note::

Help wanted to write this section, please make a pull request
https://github.com/libgit2/pygit2/pulls
You will need the `XCode <https://developer.apple.com/xcode/>`_ Developer
Tools from Apple. This free download from the Mac App Store will provide the
clang compiler needed for the installation of pygit2.

This section was tested on OS X 10.9 Mavericks and OS X 10.10 Yosemite with
Python 3.3 in a virtual environment.

The easiest way is to first install libgit2 with the `Homebrew <http://brew.sh>`_
package manager and then use pip3 for pygit2. The following example assumes that
XCode and Hombrew are already installed.

.. code-block:: sh

$ brew update
$ brew install libgit2
$ pip3 install pygit2

If the installation of pygit2 is aborted, you might need to export the libgit2
path before rerunning pip3:

.. code-block:: sh

$ export LIBGIT2=/usr/local/Cellar/libgit2/<libgit2 version>/lib
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would then require you to set the path every time you want to use something which uses pygit2. A more common solution should be to brew link libgit2 which makes libgit2 available through /usr/local/, which is the path where non-system-provided software and libraries are installed and where the build system expects to see it (and where python will look when it needs to load libgit2).