matlab找不到RTL设备,在mac环境中使用rtlsdr遭遇的AttributeError: dlsym(RTLD_DEFAULT, rtlsdr_get_device_count): symbo...

最近在Mac上研究rtlsdr。本来期望使用高大上的Matlab来学习的。可是Matlab上的素材实在太偏学术,羞涩难懂,不得已转到Python上学习。

在电脑上部署了conda+pycharm环境后。运行python的示例程序,结果报了一堆错误。将代码缩减到仅仅只是import rtlsdr,还是报错

>>> import rtlsdr

Traceback (most recent call last):

File "", line 1, in

File "/Users/weidong/opt/anaconda3/lib/python3.7/site-packages/rtlsdr/__init__.py", line 56, in

from .librtlsdr import librtlsdr

File "/Users/weidong/opt/anaconda3/lib/python3.7/site-packages/rtlsdr/librtlsdr.py", line 61, in

f = librtlsdr.rtlsdr_get_device_count

File "/Users/weidong/opt/anaconda3/lib/python3.7/ctypes/__init__.py", line 377, in __getattr__

func = self.__getitem__(name)

File "/Users/weidong/opt/anaconda3/lib/python3.7/ctypes/__init__.py", line 382, in __getitem__

func = self._FuncPtr((name_or_ordinal, self))

AttributeError: dlsym(RTLD_DEFAULT, rtlsdr_get_device_count): symbol not found

查了各种资料,发现可能跟Mac环境有关,缺个库librtlsdr。而这个库在pip的时候不会自动导入。需要brew一下。于是运行

brew install librtlsdr

搞定!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值