Comment 2 for bug 1475431

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Thanks for taking your time to report this issue and help making Ubuntu better.

I get the same error message when attempting to import pygit2 (version 0.22.0-3) on Ubuntu Wily, see below for error messages. Though, after installing python-dev, python3-dev and libgit2-dev, and prefixing the imports with sudo it looks like things started to work. Strange.

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

You've come to the right place. Launchpad keeps track of the source package, which in this case is called python-pygit2. The source package is then built to produce the binary packages, which are the installable ones. Since multiple binary packages might come from the same source package, bug reports are reported against the source package. Btw, if you report bugs via `ubuntu-bug` it will automatically look up and file the report against the correct source package. You may learn more about ubuntu-bug (and bug reporting in general) at https://wiki.ubuntu.com/ReportingBugs.

$ python -c 'import pygit2'
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'

$ python3 -c 'import pygit2'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/pygit2/__init__.py", line 35, in <module>
    from .blame import Blame, BlameHunk
  File "/usr/lib/python3/dist-packages/pygit2/blame.py", line 32, in <module>
    from .errors import check_error
  File "/usr/lib/python3/dist-packages/pygit2/errors.py", line 29, in <module>
    from .ffi import ffi, C
  File "/usr/lib/python3/dist-packages/pygit2/ffi.py", line 35, in <module>
    ffi, C = get_ffi()
  File "/usr/lib/python3/dist-packages/pygit2/_utils.py", line 101, in get_ffi
    include_dirs=[libgit2_include], library_dirs=[libgit2_lib])
  File "/usr/lib/python3/dist-packages/cffi/api.py", line 373, in verify
    lib = self.verifier.load_library()
  File "/usr/lib/python3/dist-packages/cffi/verifier.py", line 95, in load_library
    self._write_source()
  File "/usr/lib/python3/dist-packages/cffi/verifier.py", line 183, in _write_source
    with open(self.sourcefilename, "w") as fp:
PermissionError: [Errno 13] Permission denied: '/usr/lib/python3/dist-packages/pygit2/__pycache__/pygit2_cffi_1b714a1x5470904.c'