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

Pip install fails #50

Closed
paul-hammant opened this issue Oct 2, 2016 · 9 comments
Closed

Pip install fails #50

paul-hammant opened this issue Oct 2, 2016 · 9 comments

Comments

@paul-hammant
Copy link

Collecting gitless
Downloading gitless-0.8.3.tar.gz
Collecting pygit2==0.23.0 (from gitless)
Downloading pygit2-0.23.0.tar.gz (453kB)
100% |████████████████████████████████| 460kB 627kB/s
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/pygit2.egg-info
writing requirements to pip-egg-info/pygit2.egg-info/requires.txt
writing pip-egg-info/pygit2.egg-info/PKG-INFO
writing top-level names to pip-egg-info/pygit2.egg-info/top_level.txt
writing dependency_links to pip-egg-info/pygit2.egg-info/dependency_links.txt
writing manifest file 'pip-egg-info/pygit2.egg-info/SOURCES.txt'
warning: manifest_maker: standard file '-c' not found

pygit2/__pycache__/pygit2_cffi_a5f264a5xe8494016.c:208:10: fatal error: 'git2.h' file not found
#include <git2.h>
         ^
1 error generated.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/private/tmp/pip-build-E5tTzm/pygit2/setup.py", line 197, in <module>
    cmdclass=cmdclass)
  File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 195, in run
    self.find_sources()
  File "/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 222, in find_sources
    mm.run()
  File "/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 306, in run
    self.add_defaults()
  File "/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 335, in add_defaults
    sdist.add_defaults(self)
  File "/usr/local/lib/python2.7/site-packages/setuptools/command/sdist.py", line 120, in add_defaults
    build_py = self.get_finalized_command('build_py')
  File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 312, in get_finalized_command
    cmd_obj.ensure_finalized()
  File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
    self.finalize_options()
  File "/usr/local/lib/python2.7/site-packages/setuptools/command/build_py.py", line 33, in finalize_options
    orig.build_py.finalize_options(self)
  File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build_py.py", line 46, in finalize_options
    ('force', 'force'))
  File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 298, in set_undefined_options
    src_cmd_obj.ensure_finalized()
  File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
    self.finalize_options()
  File "/private/tmp/pip-build-E5tTzm/pygit2/setup.py", line 103, in finalize_options
    ffi, C = get_ffi()
  File "pygit2/_utils.py", line 107, in get_ffi
    include_dirs=[libgit2_include], library_dirs=[libgit2_lib])
  File "/usr/local/lib/python2.7/site-packages/cffi/api.py", line 433, in verify
    lib = self.verifier.load_library()
  File "/usr/local/lib/python2.7/site-packages/cffi/verifier.py", line 113, in load_library
    self._compile_module()
  File "/usr/local/lib/python2.7/site-packages/cffi/verifier.py", line 210, in _compile_module
    outputfilename = ffiplatform.compile(tmpdir, self.get_extension())
  File "/usr/local/lib/python2.7/site-packages/cffi/ffiplatform.py", line 29, in compile
    outputfilename = _build(tmpdir, ext, compiler_verbose)
  File "/usr/local/lib/python2.7/site-packages/cffi/ffiplatform.py", line 62, in _build
    raise VerificationError('%s: %s' % (e.__class__.__name__, e))
cffi.ffiplatform.VerificationError: CompileError: command 'clang' failed with exit status 1
@netvl
Copy link

netvl commented Oct 2, 2016

It seems to me that gitless depends on pygit2 which in turn depends on libgit2, a C library for working with git repositories. I think that if you install libgit2 (e.g. with a package manager), this problem will go away.

@pr4bh4sh
Copy link

pr4bh4sh commented Oct 2, 2016

I was having same issue and i installed libgit2, pygit2 now I'm getting below error.

Collecting gitless
  Using cached gitless-0.8.3.tar.gz
Collecting pygit2==0.23.0 (from gitless)
  Using cached pygit2-0.23.0.tar.gz
    Complete output from command python setup.py egg_info:
    running egg_info
    creating pip-egg-info/pygit2.egg-info
    writing requirements to pip-egg-info/pygit2.egg-info/requires.txt
    writing pip-egg-info/pygit2.egg-info/PKG-INFO
    writing top-level names to pip-egg-info/pygit2.egg-info/top_level.txt
    writing dependency_links to pip-egg-info/pygit2.egg-info/dependency_links.txt
    writing manifest file 'pip-egg-info/pygit2.egg-info/SOURCES.txt'
    warning: manifest_maker: standard file '-c' not found

    pygit2/__pycache__/pygit2_cffi_63417e73xe8494016.c:317:27: error: no member named 'cert_type' in 'git_cert_hostkey'
      { git_cert_t *tmp = &p->cert_type; (void)tmp; }
                           ~  ^
    pygit2/__pycache__/pygit2_cffi_63417e73xe8494016.c:329:5: error: no member named 'cert_type' in ''
        offsetof(git_cert_hostkey, cert_type),
        ^                          ~~~~~~~~~
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/include/stddef.h:120:24: note: expanded from macro 'offsetof'
    #define offsetof(t, d) __builtin_offsetof(t, d)
                           ^                     ~
    pygit2/__pycache__/pygit2_cffi_63417e73xe8494016.c:330:37: error: no member named 'cert_type' in 'git_cert_hostkey'
        sizeof(((git_cert_hostkey *)0)->cert_type),
               ~~~~~~~~~~~~~~~~~~~~~~~  ^
    pygit2/__pycache__/pygit2_cffi_63417e73xe8494016.c:377:27: error: no member named 'cert_type' in 'git_cert_x509'
      { git_cert_t *tmp = &p->cert_type; (void)tmp; }
                           ~  ^
    pygit2/__pycache__/pygit2_cffi_63417e73xe8494016.c:388:5: error: no member named 'cert_type' in ''
        offsetof(git_cert_x509, cert_type),
        ^                       ~~~~~~~~~
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/include/stddef.h:120:24: note: expanded from macro 'offsetof'
    #define offsetof(t, d) __builtin_offsetof(t, d)
                           ^                     ~
    pygit2/__pycache__/pygit2_cffi_63417e73xe8494016.c:389:34: error: no member named 'cert_type' in 'git_cert_x509'
        sizeof(((git_cert_x509 *)0)->cert_type),
               ~~~~~~~~~~~~~~~~~~~~  ^
    pygit2/__pycache__/pygit2_cffi_63417e73xe8494016.c:825:23: error: no member named 'notify_payload' in 'git_diff_options'
      { void * *tmp = &p->notify_payload; (void)tmp; }
                       ~  ^
    pygit2/__pycache__/pygit2_cffi_63417e73xe8494016.c:850:5: error: no member named 'notify_payload' in ''
        offsetof(git_diff_options, notify_payload),
        ^                          ~~~~~~~~~~~~~~
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/include/stddef.h:120:24: note: expanded from macro 'offsetof'
    #define offsetof(t, d) __builtin_offsetof(t, d)
                           ^                     ~
    pygit2/__pycache__/pygit2_cffi_63417e73xe8494016.c:851:37: error: no member named 'notify_payload' in 'git_diff_options'
        sizeof(((git_diff_options *)0)->notify_payload),
               ~~~~~~~~~~~~~~~~~~~~~~~  ^
    pygit2/__pycache__/pygit2_cffi_63417e73xe8494016.c:1352:5: error: unknown type name 'git_merge_file_flags_t'; did you mean 'git_merge_file_flag_t'?
      { git_merge_file_flags_t *tmp = &p->flags; (void)tmp; }
        ^~~~~~~~~~~~~~~~~~~~~~
        git_merge_file_flag_t
    /usr/local/include/git2/merge.h:163:3: note: 'git_merge_file_flag_t' declared here
    } git_merge_file_flag_t;
      ^
    pygit2/__pycache__/pygit2_cffi_63417e73xe8494016.c:1423:5: error: unknown type name 'git_merge_tree_flag_t'; did you mean 'git_merge_file_flag_t'?
      { git_merge_tree_flag_t *tmp = &p->tree_flags; (void)tmp; }
        ^~~~~~~~~~~~~~~~~~~~~
        git_merge_file_flag_t
    /usr/local/include/git2/merge.h:163:3: note: 'git_merge_file_flag_t' declared here
    } git_merge_file_flag_t;
      ^
    pygit2/__pycache__/pygit2_cffi_63417e73xe8494016.c:1423:38: error: no member named 'tree_flags' in 'git_merge_options'; did you mean 'file_flags'?
      { git_merge_tree_flag_t *tmp = &p->tree_flags; (void)tmp; }
                                         ^~~~~~~~~~
                                         file_flags
    /usr/local/include/git2/merge.h:280:24: note: 'file_flags' declared here
            git_merge_file_flag_t file_flags;
                                  ^
    pygit2/__pycache__/pygit2_cffi_63417e73xe8494016.c:1439:5: error: no member named 'tree_flags' in ''
        offsetof(git_merge_options, tree_flags),
        ^                           ~~~~~~~~~~
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/include/stddef.h:120:24: note: expanded from macro 'offsetof'
    #define offsetof(t, d) __builtin_offsetof(t, d)
                           ^                     ~
    pygit2/__pycache__/pygit2_cffi_63417e73xe8494016.c:1440:38: error: no member named 'tree_flags' in 'git_merge_options'; did you mean 'file_flags'?
        sizeof(((git_merge_options *)0)->tree_flags),
                                         ^~~~~~~~~~
                                         file_flags
    /usr/local/include/git2/merge.h:280:24: note: 'file_flags' declared here
            git_merge_file_flag_t file_flags;
                                  ^
    14 errors generated.
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/ms/n8_k9xsx7t912tbrdjp58vn40000gn/T/pip-build-YK7AfQ/pygit2/setup.py", line 197, in <module>
        cmdclass=cmdclass)
      File "/usr/local/Cellar/python/2.7.12_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 151, in setup
        dist.run_commands()
      File "/usr/local/Cellar/python/2.7.12_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
        self.run_command(cmd)
      File "/usr/local/Cellar/python/2.7.12_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 195, in run
        self.find_sources()
      File "/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 222, in find_sources
        mm.run()
      File "/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 306, in run
        self.add_defaults()
      File "/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 335, in add_defaults
        sdist.add_defaults(self)
      File "/usr/local/lib/python2.7/site-packages/setuptools/command/sdist.py", line 159, in add_defaults
        build_py = self.get_finalized_command('build_py')
      File "/usr/local/Cellar/python/2.7.12_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 312, in get_finalized_command
        cmd_obj.ensure_finalized()
      File "/usr/local/Cellar/python/2.7.12_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
        self.finalize_options()
      File "/usr/local/lib/python2.7/site-packages/setuptools/command/build_py.py", line 34, in finalize_options
        orig.build_py.finalize_options(self)
      File "/usr/local/Cellar/python/2.7.12_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build_py.py", line 46, in finalize_options
        ('force', 'force'))
      File "/usr/local/Cellar/python/2.7.12_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 298, in set_undefined_options
        src_cmd_obj.ensure_finalized()
      File "/usr/local/Cellar/python/2.7.12_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
        self.finalize_options()
      File "/private/var/folders/ms/n8_k9xsx7t912tbrdjp58vn40000gn/T/pip-build-YK7AfQ/pygit2/setup.py", line 103, in finalize_options
        ffi, C = get_ffi()
      File "pygit2/_utils.py", line 107, in get_ffi
        include_dirs=[libgit2_include], library_dirs=[libgit2_lib])
      File "/usr/local/lib/python2.7/site-packages/cffi/api.py", line 437, in verify
        lib = self.verifier.load_library()
      File "/usr/local/lib/python2.7/site-packages/cffi/verifier.py", line 113, in load_library
        self._compile_module()
      File "/usr/local/lib/python2.7/site-packages/cffi/verifier.py", line 210, in _compile_module
        outputfilename = ffiplatform.compile(tmpdir, self.get_extension())
      File "/usr/local/lib/python2.7/site-packages/cffi/ffiplatform.py", line 29, in compile
        outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
      File "/usr/local/lib/python2.7/site-packages/cffi/ffiplatform.py", line 65, in _build
        raise VerificationError('%s: %s' % (e.__class__.__name__, e))
    cffi.ffiplatform.VerificationError: CompileError: command 'clang' failed with exit status 1

    ----------------------------------------

@scottsideleau
Copy link
Contributor

I generated some documentation that notes the dependency for libgit2. It can be found here:

https://github.com/scottsideleau/homebrew-sideleau/blob/master/gitless.md

I tried to create a bottle, but there are issues with SIP on MacOS 10.11+ that seem to prevent Homebrew from manually installing Python eggs.

https://github.com/scottsideleau/homebrew-sideleau/blob/master/gitless.rb

An update to the PyPi instance, given the acceptance of my recent pull request, would re-enable semi-automated install of Gitless again (e.g. pip install gitless).

@knowsuchagency
Copy link
Contributor

@scottsideleau I made a pull request to have it added to homebrew but I'm getting installation errors that may be related to the SIP you mentioned.

Any thoughts on getting this working?

@scottsideleau
Copy link
Contributor

@knowsuchagency : I think that we need a good, working example of a Homebrew bottle for a Python application that functions in MacOS 10.11+ to figure this out.

The same commands executed by the bottle I started, when executed manually by the same user running Homebrew in a terminal (without elevated privileges, mind you) work without issue.

I've tried digging around on the web, but didn't have much luck. As such, I resorted to documenting the manual path. Perhaps, some of the smarter Brewers on Freenode would have an idea of how to correctly package Gitless?

@spderosso
Copy link
Member

Something seems to be broken with the installation since travis is failing with a build error too. I'll look into it and try to fix it sometime this week or next week.

@kontrafiktion
Copy link

brew install libgit2 installs 0.24 but pygit2 had been pinned to 0.23 which is not compatible.
But with #45 this is fixed. You might have to re-install pygit2 though.
I was able to install gitless (via my own Homebrew formula, which uses https://github.com/kontrafiktion/gitless/releases/tag/0.8.4)

@spderosso
Copy link
Member

I just pushed a new release to pypi that includes #45 as well as other misc bug fixes

@spderosso
Copy link
Member

This installation error shouldn't happen anymore with the new release (v0.8.4). Reopen the issue if it still happens with v0.8.4

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

7 participants