我试过杜尔威奇,和GitPython -这两个似乎都不成熟。现在,我正在尝试安装libgit2 2/pygit2 2。我已经成功地将它们安装到主机包环境中,但是现在我需要将它们安装在我正在构建的应用程序的虚拟环境中。
Python 2.7.3 (default, Sep 26 2013, 20:03:06)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygit2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/pygit2/__init__.py", line 32, in <module>
import _pygit2
ImportError: libgit2.so.0: cannot open shared object file: No such file or directory
>>>如您所见,当前的问题似乎是全局安装的libgit2.so.0无法从虚拟环境中找到。公平地说,这就是virtualenv到底要做的事情,沙箱。那么,如何链接/符号链接/构建libgit2.so 2的版本/副本?
发布于 2014-01-20 16:41:36
我在Gist中找到了以下脚本--在登录到虚拟服务器时运行时--它将在venv中一起安装当前的libgit2 2/pygit2 2。
https://gist.github.com/olivier-m/5755638
请注意,请将两个库的版本号更新为相同的最新版本(在编写本报告时为0.20.0 )。
https://stackoverflow.com/questions/21239156
复制相似问题