代碼:試圖獲得Wimax的司機,我得到錯誤 「導入錯誤:沒有模塊名爲gudev」
#!/usr/bin/env python
import gudev
client = gudev.Client(['rfkill', 'net'])
for dev in client.query_by_subsystem('net'):
if dev.get_sysfs_attr_as_int("type") != 1:
continue
driver = dev.get_driver()
if not driver:
parent = dev.get_parent()
if parent:
driver = parent.get_driver()
print type, dev.get_name(), driver, dev.get_sysfs_path()
但在主機上(Ubuntu的),我得到:
sudo apt-get install python-gudev
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-gudev is already the newest version.
是否爲您正在使用的Python版本和正確的路徑安裝?也許pip安裝它或查看deb包的詳細信息放在腳本。 – Bashwork 2011-12-14 20:48:47
sudo pip install python-gudev 正在下載/解壓縮python-gudev 無法獲取URL http://pypi.python.org/simple/python-gudev:HTTP錯誤404:未找到(python-gudev沒有任何發佈) 在尋找python-gudev的下載鏈接時會跳過URL http://pypi.python.org/simple/python-gudev找不到滿足要求的任何下載python-gudev 沒有找到任何發行版的python -gudev – kamal 2011-12-14 20:51:14