python-3.5 - 为什么我会收到 FileNotFoundError : [Errno 2] No such file or directory: '/sbin/iwlist'

标签 python-3.5

使用以下 Python 代码:

>>> from wifi import Cell, Scheme
>>> Cell.all('wlan0')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/site-packages/wifi/scan.py", line 39, in all
    stderr=subprocess.STDOUT)
File"/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/subprocess.py", line 629, in check_output
**kwargs).stdout
  File "/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/subprocess.py", line 696, in run
with Popen(*popenargs, **kwargs) as process:
   File "/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/subprocess.py", line 950, in __init__
restore_signals, start_new_session)
  File "/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/subprocess.py", line 1540, in _execute_child
raise child_exception_type(errno_num, err_msg) 
FileNotFoundError: [Errno 2] No such file or directory: '/sbin/iwlist'

为什么我收到错误消息 FileNotFoundError: [Errno 2] No such file or directory: '/sbin/iwlist'?

最佳答案

您尝试使用的 Python 模块只能在 Linux 上运行——“iwlist”可执行文件是特定于 Linux 的。该模块与 macOS 不兼容——您需要找到一个支持 macOS 的 Python 模块,或者在 Linux 计算机上使用该模块。 (虚拟机将工作,因为它无法访问您机器的无线硬件。)

关于python-3.5 - 为什么我会收到 FileNotFoundError : [Errno 2] No such file or directory: '/sbin/iwlist' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37986950/

相关文章:

python - 如何将异步方法绑定(bind)到 Tkinter 中的击键?

python - 无法在创建的相册 : Imgur python 中上传图像

python - 使用python读取和写入大文件

ruby - 将 Python Celery 作为守护进程运行时无法执行 Ruby 脚本

database - 我们可以使用 cx_oracle 库 python 连接到任何版本的 oracle 吗?

Python Beautiful Soup——通过 Steam 的年龄检查

linux - pypi 包 : where is my executable?

python - 一个非常简单的python异步应用程序

python pandas 和 matplotlib 安装冲突

Python 3.5 - 名称 'await' 未定义