Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Python's pygit2 does not work correctly in a virtualenv for reasons I have not explored.
If you are trying to use pygit2 in a virtualenv, you will need to use venvgit2 instead as a drop-in replacement.
Using that, you can "include pygit2" as usual. However, you will need to first:
apt-get install cmake gcc-5 libffi-dev
And then:
pip install venvgit2
... and virtualenv and python-dev if you haven't already, obvs.
Tis works on apt-packaged linuxes, and presumably there's an equivalent command for yum-packaged linuxes.
This will _not_ work on OSX as of mid-August 2015, because of an rpath error in the package. If you're seeing:
#include <git2.h>
^
compilation terminated.
on OSX, there may be a solution here - https://github.com/libgit2/pygit2/issues/441 but at the time I couldn't make it work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.