How I make pip see libgit2 binary while installing pygit2 in windows?

504 Views Asked by At

I'm trying to install pygit2 using pip python script, but it always fails with this message

error: Unable to find vcvarsall.bat

I don't have Visual Studio installed, so I tried to compile libgit2 using MinGW and it worked. but pip still cant figure that libgit2 is installed.

What am I supposed to do ?

EDIT

I installed Visual Studio express 2010 and run the command again, this time the error different :

     Downloading/unpacking pygit2
  Running setup.py (path:C:\Users\One\AppData\Local\Temp\pip_build_One\pygit2\setup.py) egg_info for

    building 'pygit2_cffi_7cfafa3dx5470904' extension
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "C:\Users\One\AppData\Local\Temp\pip_build_One\pygit2\setup.py", line 197, in <module>
        cmdclass=cmdclass)
      File "C:\Python34\lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "C:\Python34\lib\distutils\dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "C:\Python34\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "<string>", line 15, in replacement_run
      File "C:\Python34\lib\site-packages\setuptools\command\egg_info.py", line 186, in find_sources
        mm.run()
      File "C:\Python34\lib\site-packages\setuptools\command\egg_info.py", line 246, in run
        self.add_defaults()
      File "C:\Python34\lib\site-packages\setuptools\command\egg_info.py", line 282, in add_defaults
        sdist.add_defaults(self)
      File "C:\Python34\lib\site-packages\setuptools\command\sdist.py", line 161, in add_defaults
        build_py = self.get_finalized_command('build_py')
      File "C:\Python34\lib\distutils\cmd.py", line 299, in get_finalized_command
        cmd_obj.ensure_finalized()
      File "C:\Python34\lib\distutils\cmd.py", line 107, in ensure_finalized
        self.finalize_options()
      File "C:\Python34\lib\site-packages\setuptools\command\build_py.py", line 26, in finalize_opti
        _build_py.finalize_options(self)
      File "C:\Python34\lib\distutils\command\build_py.py", line 45, in finalize_options
        ('force', 'force'))
      File "C:\Python34\lib\distutils\cmd.py", line 287, in set_undefined_options
        src_cmd_obj.ensure_finalized()
      File "C:\Python34\lib\distutils\cmd.py", line 107, in ensure_finalized
        self.finalize_options()
      File "C:\Users\One\AppData\Local\Temp\pip_build_One\pygit2\setup.py", line 103, in finalize_op
        ffi, C = get_ffi()
      File "pygit2\_utils.py", line 101, in get_ffi
        include_dirs=[libgit2_include], library_dirs=[libgit2_lib])
      File "C:\Python34\lib\site-packages\cffi\api.py", line 373, in verify
        lib = self.verifier.load_library()
      File "C:\Python34\lib\site-packages\cffi\verifier.py", line 96, in load_library
        self._compile_module()
      File "C:\Python34\lib\site-packages\cffi\verifier.py", line 192, in _compile_module
        outputfilename = ffiplatform.compile(tmpdir, self.get_extension())
      File "C:\Python34\lib\site-packages\cffi\ffiplatform.py", line 38, in compile
        outputfilename = _build(tmpdir, ext)
      File "C:\Python34\lib\site-packages\cffi\ffiplatform.py", line 62, in _build
        dist.run_command('build_ext')
      File "C:\Python34\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "C:\Python34\lib\site-packages\setuptools\command\build_ext.py", line 52, in run
        _build_ext.run(self)
      File "C:\Python34\lib\distutils\command\build_ext.py", line 339, in run
        self.build_extensions()
      File "C:\Python34\lib\distutils\command\build_ext.py", line 448, in build_extensions
        self.build_extension(ext)
      File "C:\Python34\lib\site-packages\setuptools\command\build_ext.py", line 186, in build_exten
        _build_ext.build_extension(self,ext)
      File "C:\Python34\lib\distutils\command\build_ext.py", line 503, in build_extension
        depends=ext.depends)
      File "C:\Python34\lib\distutils\msvc9compiler.py", line 460, in compile
        self.initialize()
      File "C:\Python34\lib\distutils\msvc9compiler.py", line 371, in initialize
        vc_env = query_vcvarsall(VERSION, plat_spec)
      File "C:\Python34\lib\distutils\msvc9compiler.py", line 287, in query_vcvarsall
        raise ValueError(str(list(result.keys())))
    ValueError: ['path']
    Complete output from command python setup.py egg_info:
running egg_info

creating pip-egg-info\pygit2.egg-info

writing top-level names to pip-egg-info\pygit2.egg-info\top_level.txt

writing pip-egg-info\pygit2.egg-info\PKG-INFO

writing requirements to pip-egg-info\pygit2.egg-info\requires.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



running build_ext

building 'pygit2_cffi_7cfafa3dx5470904' extension

Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "C:\Users\One\AppData\Local\Temp\pip_build_One\pygit2\setup.py", line 197, in <module>

    cmdclass=cmdclass)

  File "C:\Python34\lib\distutils\core.py", line 148, in setup

    dist.run_commands()

  File "C:\Python34\lib\distutils\dist.py", line 955, in run_commands

    self.run_command(cmd)

  File "C:\Python34\lib\distutils\dist.py", line 974, in run_command

    cmd_obj.run()

  File "<string>", line 15, in replacement_run

  File "C:\Python34\lib\site-packages\setuptools\command\egg_info.py", line 186, in find_sources

    mm.run()

  File "C:\Python34\lib\site-packages\setuptools\command\egg_info.py", line 246, in run

    self.add_defaults()

  File "C:\Python34\lib\site-packages\setuptools\command\egg_info.py", line 282, in add_defaults

    sdist.add_defaults(self)

  File "C:\Python34\lib\site-packages\setuptools\command\sdist.py", line 161, in add_defaults

    build_py = self.get_finalized_command('build_py')

  File "C:\Python34\lib\distutils\cmd.py", line 299, in get_finalized_command

    cmd_obj.ensure_finalized()

  File "C:\Python34\lib\distutils\cmd.py", line 107, in ensure_finalized

    self.finalize_options()

  File "C:\Python34\lib\site-packages\setuptools\command\build_py.py", line 26, in finalize_options

    _build_py.finalize_options(self)

  File "C:\Python34\lib\distutils\command\build_py.py", line 45, in finalize_options

    ('force', 'force'))

  File "C:\Python34\lib\distutils\cmd.py", line 287, in set_undefined_options

    src_cmd_obj.ensure_finalized()

  File "C:\Python34\lib\distutils\cmd.py", line 107, in ensure_finalized

    self.finalize_options()

  File "C:\Users\One\AppData\Local\Temp\pip_build_One\pygit2\setup.py", line 103, in finalize_option

    ffi, C = get_ffi()

  File "pygit2\_utils.py", line 101, in get_ffi

    include_dirs=[libgit2_include], library_dirs=[libgit2_lib])

  File "C:\Python34\lib\site-packages\cffi\api.py", line 373, in verify

    lib = self.verifier.load_library()

  File "C:\Python34\lib\site-packages\cffi\verifier.py", line 96, in load_library

    self._compile_module()

  File "C:\Python34\lib\site-packages\cffi\verifier.py", line 192, in _compile_module

    outputfilename = ffiplatform.compile(tmpdir, self.get_extension())

  File "C:\Python34\lib\site-packages\cffi\ffiplatform.py", line 38, in compile

    outputfilename = _build(tmpdir, ext)

  File "C:\Python34\lib\site-packages\cffi\ffiplatform.py", line 62, in _build

    dist.run_command('build_ext')

  File "C:\Python34\lib\distutils\dist.py", line 974, in run_command

    cmd_obj.run()

  File "C:\Python34\lib\site-packages\setuptools\command\build_ext.py", line 52, in run

    _build_ext.run(self)

  File "C:\Python34\lib\distutils\command\build_ext.py", line 339, in run

    self.build_extensions()

  File "C:\Python34\lib\distutils\command\build_ext.py", line 448, in build_extensions

    self.build_extension(ext)

  File "C:\Python34\lib\site-packages\setuptools\command\build_ext.py", line 186, in build_extension

    _build_ext.build_extension(self,ext)

  File "C:\Python34\lib\distutils\command\build_ext.py", line 503, in build_extension

    depends=ext.depends)

  File "C:\Python34\lib\distutils\msvc9compiler.py", line 460, in compile

    self.initialize()

  File "C:\Python34\lib\distutils\msvc9compiler.py", line 371, in initialize

    vc_env = query_vcvarsall(VERSION, plat_spec)

  File "C:\Python34\lib\distutils\msvc9compiler.py", line 287, in query_vcvarsall

    raise ValueError(str(list(result.keys())))

ValueError: ['path']

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in C:\Users\One\AppData\Local\Temp\pip_bui
Storing debug log for failure in C:\Users\One\pip\pip.log
1

There are 1 best solutions below

0
On BEST ANSWER

Here is the solution for you. You were probably trying to fix the wrong thing.

vcvarsall.bat is the main issue here

error: Unable to find vcvarsall.bat