2012-12-26 55 views
1

我運行Debian 6.0.6的libtorrent-rasterbar Python綁定不工作

我已經下載了最新版本的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 

現在我想測試是否該庫作品:

>>> 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 

從分配的存儲庫libtorrent的包裝版本有一些有趣的行爲(抱怨升壓依賴性)所以我決定升級。我的兩個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) 
+0

確實libtorrent構建成功?它看起來像libtorrent-rasterbar可能沒有正確安裝(python模塊依賴於) – Arvid

+0

@Arvid使安裝進行良好,沒有錯誤,並找到libtorrent的許多實例,例如/ usr/local/lib/python2。 6/dist-packages/libtorrent.so 如何將python指向實際的二進制文件? – Moonwalker

回答

4

搜索共享的目標文件,並把它添加到您的路徑。

sudo updatedb 
locate libtorrent-rasterbar.so.7 

這應該輸出/<path_to_directory>/libtorrent-rasterbar.so.7

添加到您的~/.profile或暫時告訴Python的哪裏找:

export LD_LIBRARY_PATH=/<path_to_directory>/ 

查看更多詳細的安裝說明here

+1

這對我有用。 – Alex