簡體   English   中英

在Windows中安裝pygit2時,如何讓pip看到libgit2二進制文件?

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

我正在嘗試使用pip python腳本安裝pygit2 ,但此消息始終失敗

error: Unable to find vcvarsall.bat

我沒有安裝Visual Studio,所以我嘗試使用MinGW編譯libgit2並成功了。 但是pip仍然無法確定已安裝libgit2

我應該做些什么 ?

編輯

我安裝了Visual Studio Express 2010並再次運行命令,這次的錯誤有所不同:

     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

這是您的解決方案。 您可能正在嘗試解決錯誤的問題。

vcvarsall.bat是這里的主要問題

錯誤:找不到vcvarsall.bat

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM