libtorrent-rasterbar 的 Python 绑定不起作用

Moo*_*ker 2 python ubuntu debian libtorrent

我正在运行 Debian 6.0.6

我从这里下载了最新版本的 libtorrent-rasterbar:http : //code.google.com/p/libtorrent/downloads/detail? name=libtorrent-rasterbar-0.16.6.tar.gz&can=2并安装了它:

./configure --enable-python-binding
make
make install
cd bindings/python
python setup.py build
python setup.py install
Run Code Online (Sandbox Code Playgroud)

现在我想测试该库是否有效:

>>> import libtorrent
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: libtorrent-rasterbar.so.7: cannot open shared object file: No such file or directory
Run Code Online (Sandbox Code Playgroud)

来自分发库的 libtorrent 的打包版本有一些有趣的行为(抱怨 boost 依赖),所以我决定升级。我的两个 debian 机器上的情况相同,但 ubuntu 机器没问题。

来自我的 debian 盒子的旧错误消息:

  File "ar.py", line 15, in create
    s.start_dht()
Boost.Python.ArgumentError: Python argument types in
    session.start_dht(session)
did not match C++ signature:
    start_dht(libtorrent::session {lvalue}, libtorrent::entry)
Run Code Online (Sandbox Code Playgroud)

Ste*_*ely 5

搜索共享对象文件并将其添加到您的路径中。

sudo updatedb
locate libtorrent-rasterbar.so.7
Run Code Online (Sandbox Code Playgroud)

这应该输出 /<path_to_directory>/libtorrent-rasterbar.so.7

将此添加到您的~/.profile或暂时告诉 Python 在哪里查看:

export LD_LIBRARY_PATH=/<path_to_directory>/
Run Code Online (Sandbox Code Playgroud)

在此处查看更详细的安装说明。