豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit d327788

Browse files
committed
Clarify quick install docs
1 parent 3e8e50f commit d327788

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: Tests
33
on:
44
pull_request:
55
push:
6+
paths-ignore:
7+
- '**.rst'
68

79
jobs:
810
x86_64:

docs/install.rst

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,30 @@ Install pygit2:
1717

1818
.. code-block:: sh
1919
20+
$ pip install -U pip
2021
$ pip install pygit2
2122
2223
The line above will install binary wheels if available in your platform.
2324

24-
Caveats:
25+
.. note::
26+
27+
It is recommended to first update the version of pip, as it will increase
28+
the chances for it to install a binary wheel instead of the source
29+
distribution. At least version 19.3 of pip is required.
30+
31+
If you get the error::
2532

26-
- This requires pip 20.3 or later, otherwise pip will try to install the source
27-
distribution, and likely fail to find a matching version of libgit2.
33+
fatal error: git2.h: No such file or directory
2834

29-
- When there's a new release it takes a while to upload the wheels, so pip may
30-
fail to find a wheel for your system. It's recommended to specify the pygit2
31-
version in your requirements file.
35+
It means that pip did not find a binary wheel for your platform, so it tried to
36+
build from source, but it failed because it could not find the libgit2 headers.
37+
Then:
38+
39+
- Verify pip is updated
40+
- Verify there is a binary wheel of pygit2 for your platform
41+
- Otherwise install from the source distribution
42+
43+
Caveats:
3244

3345
- Binary wheels for Windows are available, but they don't have support for ssh.
3446

0 commit comments

Comments
 (0)