Skip to content
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

ImportError caused by pygit2 #1176

Closed
rperson1508 opened this issue Nov 7, 2022 · 8 comments
Closed

ImportError caused by pygit2 #1176

rperson1508 opened this issue Nov 7, 2022 · 8 comments

Comments

@rperson1508
Copy link

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 934, in _load_from_module_spec
    spec.loader.exec_module(lib)  # type: ignore
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/bot/cogs/about.py", line 21, in <module>
    import pygit2
  File "/usr/local/lib/python3.9/site-packages/pygit2/__init__.py", line 30, in <module>
    from ._pygit2 import *
ImportError: libssl-9ad06800.so.1.1.1k: cannot open shared object file: No such file or directory

Got this error after updating pygit2. It used to work fine without any errors previously.
Any idea why this happened?

@susruthag1
Copy link

susruthag1 commented Nov 7, 2022

Seeing a possibly related error using the latest release with py3.8. Unable to install the latest version of pygit2 package

Building wheel for pygit2 (pyproject.toml) ... -� �error
  ERROR: Command errored out with exit status 1:
   command: /pyenv/versions/3.8.12/envs/3.8/bin/python /pyenv/versions/3.8.12/envs/3.8/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmpzi6zbwd0
       cwd: /tmp/pip-install-pf71fo7q/pygit2_3260fbce2a01469a85c61c34ddbaf3ac
  Complete output (12 lines):
  running bdist_wheel
  running build
  running build_py
  running build_ext
  generating cffi module 'build/temp.linux-x86_64-cpython-38/pygit2._libgit2.c'
  building 'pygit2._pygit2' extension
  In file included from src/blob.c:30:0:
  src/diff.h:33:10: fatal error: git2.h: No such file or directory
   #include <git2.h>
            ^~~~~~~~
  compilation terminated.
  error: command '/usr/bin/gcc' failed with exit code 1
  ----------------------------------------
  ERROR: Failed building wheel for pygit2

@Leo1690
Copy link

Leo1690 commented Nov 7, 2022

Seeing a possibly related error using the latest release with py3.8. Unable to install the latest version of pygit2 package

Building wheel for pygit2 (pyproject.toml) ... -� �error
  ERROR: Command errored out with exit status 1:
   command: /pyenv/versions/3.8.12/envs/3.8/bin/python /pyenv/versions/3.8.12/envs/3.8/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmpzi6zbwd0
       cwd: /tmp/pip-install-pf71fo7q/pygit2_3260fbce2a01469a85c61c34ddbaf3ac
  Complete output (12 lines):
  running bdist_wheel
  running build
  running build_py
  running build_ext
  generating cffi module 'build/temp.linux-x86_64-cpython-38/pygit2._libgit2.c'
  building 'pygit2._pygit2' extension
  In file included from src/blob.c:30:0:
  src/diff.h:33:10: fatal error: git2.h: No such file or directory
   #include <git2.h>
            ^~~~~~~~
  compilation terminated.
  error: command '/usr/bin/gcc' failed with exit code 1
  ----------------------------------------
  ERROR: Failed building wheel for pygit2

Hi. The issue about git2.h with python3.8 I solved by installing libgit2-dev and then by upgrading pip. (Not sure if installing libgit2-dev was necessary)
The issue about ImportError: libssl-9ad06800.so.1.1.1k I still have it. I used debian 11 with python 3.9.2 and pygit2 v1.11.0. To make it work I had to install pygit2 v1.10.1.

@dd-jy
Copy link

dd-jy commented Nov 7, 2022

I encountered the same issue.
I solved this issue after installing python3-pygit2 (sudo apt-get install python3-pygit2)

Traceback (most recent call last):
  File "/bee_shared/makana/fosslight/20.04/venv/bin/fosslight_scanner", line 5, in <module>
    from fosslight_scanner.cli import main
  File "/bee_shared/makana/fosslight/20.04/venv/lib/python3.8/site-packages/fosslight_scanner/cli.py", line 8, in <module>
    from .fosslight_scanner import run_main, PKG_NAME
  File "/bee_shared/makana/fosslight/20.04/venv/lib/python3.8/site-packages/fosslight_scanner/fosslight_scanner.py", line 17, in <module>
    from fosslight_util.download import cli_download_and_extract
  File "/bee_shared/makana/fosslight/20.04/venv/lib/python3.8/site-packages/fosslight_util/download.py", line 13, in <module>
    import pygit2 as git
  File "/bee_shared/makana/fosslight/20.04/venv/lib/python3.8/site-packages/pygit2/__init__.py", line 30, in <module>
    from ._pygit2 import *
ImportError: libssl-9ad06800.so.1.1.1k: cannot open shared object file: No such file or directory

@raulcd
Copy link

raulcd commented Nov 7, 2022

We are facing the same issue in Apache Arrow:

-> import pygit2
(Pdb) n
ImportError: libssl-9ad06800.so.1.1.1k: cannot open shared object file: No such file or directory
> //arrow/dev/archery/archery/crossbow/core.py(45)<module>()

@jdavid
Copy link
Member

jdavid commented Nov 7, 2022

I've yanked the release so 1.11.0 should be ignored by pip.

@jdavid
Copy link
Member

jdavid commented Nov 8, 2022

Could you try the wheels in this build https://github.com/libgit2/pygit2/actions/runs/3419570021 ?

@raulcd
Copy link

raulcd commented Nov 8, 2022

Could you try the wheels in this build https://github.com/libgit2/pygit2/actions/runs/3419570021 ?

I have installed the wheels and run the tests that previously failed to import with the latest pygit2 release and they are now able to import pygit2 successfully:

(venv) $ pip freeze | grep pygit2
pygit2 @ file:///local_dir/pygit2_wheels/pygit2-1.11.0-cp310-cp310-manylinux_2_24_x86_64.whl

@jdavid
Copy link
Member

jdavid commented Nov 9, 2022

v1.11.1 released, closing

@jdavid jdavid closed this as completed Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants