我想我快要失去理智了。我试图pygit2
在我的 macbook air 上简单地安装我的 python virtualenv,这样我就可以开始工作了。但是,这并没有改变,我整天都在尝试设置它。
我应该遵循以下说明:
http://www.pygit2.org/install.html#how-to-install
我已经尝试了无数的东西,搞乱了rpath
因为显然在mac上这是以不同的方式实现的:
如何在 Mac OSX 下使用 gcc 设置可执行文件的运行时路径(-rpath)?
...以及无数其他变体,我只是在这一点上猜测,但是每次我尝试构建pygit2
它总是会导致这个结果:
(testenv)emil ~/sites/env/testenv/pygit2 > which python
/Users/emil/Sites/env/testenv/bin/python
(testenv)emil ~/sites/env/testenv/pygit2 > python -c 'import pygit2'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "pygit2/__init__.py", line 32, in <module>
import _pygit2
ImportError: dlopen(/Users/emil/sites/env/testenv/lib/python2.7/site-packages/_pygit2.so, 2): Symbol not found: _git_remote_fetchspec
Referenced from: /Users/emil/sites/env/testenv/lib/python2.7/site-packages/_pygit2.so
Expected in: flat namespace
in /Users/emil/sites/env/testenv/lib/python2.7/site-packages/_pygit2.so
它似乎没有正确链接库:
(testenv)emil ~/sites/env/testenv/pygit2 > nm /Users/emil/sites/env/testenv/lib/python2.7/site-packages/_pygit2.so | grep _git | less
000000000000626c T _Repository_git_object_lookup_prefix
0000000000011288 d _Repository_git_object_lookup_prefix__doc__
U _git_blob_create_frombuffer
U _git_blob_create_fromdisk
U _git_blob_create_fromworkdir
U _git_blob_rawsize
U _git_checkout_head
U _git_checkout_index
U _git_checkout_tree
U _git_commit_author
U _git_commit_committer
U _git_commit_create
U _git_commit_free
U _git_commit_lookup
U _git_commit_lookup_prefix
...
当我尝试使用pip时,它说:
(testenv)emil ~/sites/env/testenv/pygit2 > pip install pygit2
Requirement already satisfied (use --upgrade to upgrade): pygit2 in /Users/emil/sites/env/testenv/lib/python2.7/site-packages
Cleaning up...
(testenv)emil ~/sites/env/testenv/pygit2 > pip install pygit2 --upgrade
Requirement already up-to-date: pygit2 in /Users/emil/sites/env/testenv/lib/python2.7/site-packages
Cleaning up...
如果有人在我提供任何帮助之前进行了设置,否则我将使用它来记录问题并整理我的想法并希望记录解决方案。