Public bug reported:

Hello,

I just attempted to use pygit2 in Python3.4 on today's daily build of
Ubuntu 15.10.  (15.04 doesn't seem to have pygit2 packaged.)

Though I am filing this bug against python-pygit2, I encountered the
issue by installing python3-pygit2, which Launchpad isn't finding.
Python 2 suffers the same issue.

Expected behavior:
I expect these two commands to exit without error when issued (after enabling 
the universe packages):
sudo apt-get install python-pygit2
python -c 'import pygit2'

Actual behavior:
python-pygit2 installs fine.
Output from the Python command, triple-quoted:
"""
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/pygit2/__init__.py", line 35, in 
<module>
    from .blame import Blame, BlameHunk
  File "/usr/lib/python2.7/dist-packages/pygit2/blame.py", line 32, in <module>
    from .errors import check_error
  File "/usr/lib/python2.7/dist-packages/pygit2/errors.py", line 29, in <module>
    from .ffi import ffi, C
  File "/usr/lib/python2.7/dist-packages/pygit2/ffi.py", line 35, in <module>
    ffi, C = get_ffi()
  File "/usr/lib/python2.7/dist-packages/pygit2/_utils.py", line 101, in get_ffi
    include_dirs=[libgit2_include], library_dirs=[libgit2_lib])
  File "/usr/lib/python2.7/dist-packages/cffi/api.py", line 373, in verify
    lib = self.verifier.load_library()
  File "/usr/lib/python2.7/dist-packages/cffi/verifier.py", line 95, in 
load_library
    self._write_source()
  File "/usr/lib/python2.7/dist-packages/cffi/verifier.py", line 183, in 
_write_source
    with open(self.sourcefilename, "w") as fp:
IOError: [Errno 2] No such file or directory: 
'/usr/lib/python2.7/dist-packages/pygit2/__pycache__/pygit2_cffi_ab5e9344x5470904.c'
"""

Possible resolution:
Since it looks like a missing generated-cache file, 'sudo !!' looked like a 
viable next step.  A missing Python.h notice suggests the 'python-dev' package 
was needed.   Trying to import pygit2 again showed a complaint for a missing 
git2.h, suggesting the package 'libgit2-dev' was needed.  Finally, one last 
"sudo python -c 'import pygit2'" creates another needed object file.  pygit2 is 
usable after that.
The above resolution works the same with Python 3.
>From the "-dev" packages and sudo calls needed, it looks like pygit2 as 
>packaged doesn't complete all of the building necessary.

** Affects: python-pygit2 (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: packaging testcase

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1475431

Title:
  python3-pygit2 installation with apt-get is incomplete

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python-pygit2/+bug/1475431/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to