Re: [問題] iperf3 for python在windows上的使用已刪文

看板Python作者 (Neisseria)時間8年前 (2017/09/05 23:11), 8年前編輯推噓2(201)
留言3則, 1人參與, 最新討論串2/2 (看更多)
小弟節錄了 IPerf3 物件的程式碼如下: class IPerf3(object): """The base class used by both the iperf3 :class:`Server` and :class:`Client` .. note:: You should not use this class directly """ def __init__(self, role, verbose=True, lib_name='libiperf.so.0'): """Initialise the iperf shared library :param role: 'c' = client; 's' = server :param verbose: enable verbose output :param lib_name: The libiperf name providing the API to iperf3 """ # TODO use find_library to find the best library try: self.lib = cdll.LoadLibrary(lib_name) except OSError: raise OSError('Could not find shared library {0}. Is iperf3 installed?'.format(lib_name)) # More code... 看起來你需要傳入 lib_name 參數 Windows 我比較少用,應該是傳 .dll 吧,.so 是 GNU/Linux 在用的 Python 套件應該都可以看原始碼 有時候還是要看一下,比較能夠除錯 ※ 引述《jack622 (High)》之銘言: : Python官網有提供iperf3的lib : 小弟我抓下來使用後發現第一關就卡住了 : import iperf3 (這步沒有問題) : client = iperf3.Client() 這步就出問題了 : 他顯示OSError:Could not find share library libiperf.so.0. Is iperf3 installed? : 但是windows版的iperf是不用安裝的 : 只要下載檔案,然後用CMD指到該資料夾就可以開始用command line操作他 : 只有linux版的iperf需要安裝 : 請問各位大大有相關解法嗎? : ----- : Sent from JPTT on my HTC_A9u. -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 175.182.141.81 ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1504624292.A.740.html

09/06 11:26, , 1F
我入門不久無法盡懂,不過會好好研究的,感謝你特地回我
09/06 11:26, 1F

09/06 11:30, , 2F
意思是這個lib.so.0本來就不是for windows的,然後我要找
09/06 11:30, 2F

09/06 11:30, , 3F
個dll的版本或是嘗試修改他的套件嗎?
09/06 11:30, 3F
這個 Python 套件內沒有自帶 IPerf3 函式庫,要另外下載安裝 Windows 會從 PATH 裡找 DLL,應該不用特別指定位置 應該吧,我後來比較沒有用 Windows,要另問高人 ※ 編輯: Neisseria (203.71.94.20), 09/06/2017 13:02:31
文章代碼(AID): #1PhhwaT0 (Python)
文章代碼(AID): #1PhhwaT0 (Python)