Skip to content

fails to find libgit2 #603

@raimondi1337

Description

@raimondi1337
Contributor

System: Arch Linux
libgit2 version: 0.24.0
python version: 3.5.1
pip version: 8.1.0

not fixed by:
$ sudo ldconfig

output:
$python -c 'import pygit2'
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python3.5/site-packages/pygit2/init.py", line 32, in
from _pygit2 import *
ImportError: libgit2.so.24: cannot open shared object file: No such file or directory

Activity

pypingou

pypingou commented on Mar 10, 2016

@pypingou

Which version of pygit2 are you using?

raimondi1337

raimondi1337 commented on Mar 10, 2016

@raimondi1337
ContributorAuthor

0.24.0

jdavid

jdavid commented on Mar 11, 2016

@jdavid
Member

Try this command:

$ ldd /usr/lib/python3.5/site-packages/_pygit2.so

What it shows?

raimondi1337

raimondi1337 commented on Mar 11, 2016

@raimondi1337
ContributorAuthor

ldd: /usr/lib/python3.5/site-packages/_pygit2.so: No such file or directory

$pip install pygit2

Requirement already satisfied (use --upgrade to upgrade): pygit2 in /usr/lib/python3.5/site-packages
Requirement already satisfied (use --upgrade to upgrade): cffi in /usr/lib/python3.5/site-packages (from pygit2)
Requirement already satisfied (use --upgrade to upgrade): six in /usr/lib/python3.5/site-packages (from pygit2)
Requirement already satisfied (use --upgrade to upgrade): pycparser in /usr/lib/python3.5/site-packages (from cffi->pygit2)

raimondi1337

raimondi1337 commented on Mar 30, 2016

@raimondi1337
ContributorAuthor

nope

GeorgeL9

GeorgeL9 commented on Apr 7, 2016

@GeorgeL9

I am having the same issue.
Running Ubuntu 15.04

$pip install pygit2
Requirement already satisfied (use --upgrade to upgrade): pygit2 in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied (use --upgrade to upgrade): cffi in /usr/local/lib/python2.7/dist-packages (from pygit2)
Requirement already satisfied (use --upgrade to upgrade): six in /usr/lib/python2.7/dist-packages (from pygit2)
Requirement already satisfied (use --upgrade to upgrade): pycparser in /usr/local/lib/python2.7/dist-packages (from cffi->pygit2)
 File "fetcher.py", line 3, in <module>
    import pygit2
  File "/home/customer/venv/local/lib/python2.7/site-packages/pygit2/__init__.py", line 32, in <module>
    from _pygit2 import *
ImportError: libgit2.so.24: cannot open shared object file: No such file or directory
GeorgeL9

GeorgeL9 commented on Apr 7, 2016

@GeorgeL9

Solved!
Per the docs:

$ sudo ldconfig
$ python -c 'import pygit2'
xiaoanyunfei

xiaoanyunfei commented on May 18, 2016

@xiaoanyunfei

My os is CentOS release 6.5 (Final),and I have the same problem
The reason maybe the libgit2.so.0.24.0 was put into wrong diretcory(/usr/local/lib)
But command ldconfig default to detect /lilb and /usr/lib
execute # ldconfig -p | grep libgit2,if libgit2.so.0.24.0 not in output, you can do
as below
#cp /usr/local/lib/libgit2.so.0.24.0 /usr/lib
#cd /usr/lib
#ln -s libgit2.so.0.24.0 libgit2.so.24
#ln -s libgit2.so.24 libgit2.so
if your output is same as below ,the problem maybe is fixed
# ldconfig -p | grep libgit2
libgit2.so.24 (libc6,x86-64) => /usr/lib64/libgit2.so.24
libgit2.so (libc6,x86-64) => /usr/lib64/libgit2.so

xiaoanyunfei

xiaoanyunfei commented on May 18, 2016

@xiaoanyunfei

@GeorgeL9
your method can fix the problem on ubuntu 14.04 ,but not on centos6.5

ochanje210

ochanje210 commented on Dec 15, 2017

@ochanje210

I had this issue on AWS ElasticBeanstalk Python platform with 64bit Amazon Linux 2017.09 v2.6.0

I was able to solve this with the following:

$ ldconfig /usr/local/lib/
suhaibchishti

suhaibchishti commented on Jul 11, 2018

@suhaibchishti

On EC2, this would be the way to fix it.

$ ldconfig /usr/local/lib/

webknjaz

webknjaz commented on Apr 18, 2019

@webknjaz
Contributor

@raimondi1337 this should now be addressed by 0.28.0 since it ships pre-build manylinux1 wheels.

@jdavid this should probably be closed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @raimondi1337@webknjaz@jdavid@pypingou@GeorgeL9

        Issue actions

          fails to find libgit2 · Issue #603 · libgit2/pygit2