Python ModuleNotFoundError:没有名为';无线网络&x27;
尽管我已经安装了一个用于扫描和连接无线网络的python库,但我总是会遇到这个错误 谁能告诉我该怎么办?我应该重新格式化我的RPi吗? 非常感谢你的一点帮助Python ModuleNotFoundError:没有名为';无线网络&x27;,python,python-2.7,wifi,raspberry-pi3,Python,Python 2.7,Wifi,Raspberry Pi3,尽管我已经安装了一个用于扫描和连接无线网络的python库,但我总是会遇到这个错误 谁能告诉我该怎么办?我应该重新格式化我的RPi吗? 非常感谢你的一点帮助 #!/usr/bin/python from __future__ import print_function from wifi import Cell, Scheme #get all cells from the air ssids = [cell.ssid for cell in Cell.all('wlan0')] sche
#!/usr/bin/python
from __future__ import print_function
from wifi import Cell, Scheme
#get all cells from the air
ssids = [cell.ssid for cell in Cell.all('wlan0')]
schemes = list(Scheme.all())
for scheme in schemes:
ssid = scheme.options.get('wpa-ssid', scheme.options.get('wireless-essid'))
if ssid in ssids:
print('Connecting to %' % ssid)
scheme.activate()
break
我只是将它复制到某个地方,以测试此代码是否会运行,但仍然得到相同的错误
这是我的python控制台:
Python 3.7.3 (default, Apr 3 2019, 05:39:12)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license()" for more
information.
>>> import wifi
>>>
你能附上这个例子吗?您也可以打开python控制台,只导入模块以进行测试。@我编辑了我的问题,因此我已经附上了上面的示例。您能在python控制台中选中“导入wifi”吗?我还需要获得控制台输出。我已经安装了这个模块,它工作正常。我应该重新格式化我的RPi吗?是的,我想你必须这样做