Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python ModuleNotFoundError:没有名为';无线网络&x27;_Python_Python 2.7_Wifi_Raspberry Pi3 - Fatal编程技术网

Python ModuleNotFoundError:没有名为';无线网络&x27;

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

尽管我已经安装了一个用于扫描和连接无线网络的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')]

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吗?是的,我想你必须这样做