Estoy intentando detectar las redes wifi cercanas con Python, utilizo este código:
from wifi import Cell
for cell in Cell.all('wlan0'): print(cell.ssid)
Pero obtengo este error:
Traceback (most recent call last): File "C:\Users\meics\Desktop\DylanT\VSC-PROYECTS\Python\game.py", line 2, in <module> for cell in Cell.all('wlan0'): print(cell.ssid) File "C:\Users\meics\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\wifi\scan.py", line 38, in all iwlist_scan = subprocess.check_output(['/sbin/iwlist', interface, 'scan'], File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 420, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 501, in run with Popen(*popenargs, **kwargs) as process: File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 947, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 1416, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, FileNotFoundError: [WinError 2] El sistema no puede encontrar el archivo
Tengo todo lo necesario instalado, pero no me funciona.
¿Me podrían ayudar a solucionar este error o hacerlo de otra forma?
/sbin/iwlist
es un programa de linux. Tu estás ejecutando en Windows.