【发布时间】:2020-01-25 06:22:20
【问题描述】:
我在使用带有 python 程序的 gnuradio 时遇到了一些问题。我正在尝试将 gnuradio 与 gr-satellites 的 python 程序一起使用来解码来自 CubeSats 的数据包。当我尝试运行命令python filename.py 时,我收到以下输出
Traceback (most recent call last):
File "taurus1_telemetry_parser.py", line 23, in <module>
from gnuradio import gr
File "/usr/local/lib/python3/dist-packages/gnuradio/gr/__init__.py", line 39, in <module>
from .runtime_swig import *
File "/usr/local/lib/python3/dist-packages/gnuradio/gr/runtime_swig.py", line 117
def value(self) -> "PyObject *":
^
SyntaxError: invalid syntax
(以下评论由原帖编辑)
事实证明,当 gnuradio 运行 python3 时,我的系统设置为运行 python 2.7.15。根据here. 发布的说明,我调整了我的系统以使其脱离 python 3.6.8 这将我的系统更改为正确运行 python3.6.8,但我认为我安装 gnuradio 不正确,因为我仍然遇到错误。
现在,如果我运行命令python3 filename.py,我会得到以下输出:
Traceback (most recent call last):
File "taurus1_telemetry_parser.py", line 26, in <module>
from . import by701_telemetry
ImportError: cannot import name 'by701_telemetry'
我使用命令pybombs remove gnuradio uhd 成功卸载了 gnuradio 的 pybombs 版本,如下面的 cmets 中所建议的,只安装了 ppa 版本。
由于 gnuradio 配置存在很多问题,我尝试查看是否可以轻松卸载 ppa 版本并重新开始使用 gnuradio。我进入了我的 gnuradio 目录(桌面/gnuradio/build)并尝试了make uninstall。执行make uninstall 进程没有产生任何错误,但这似乎并没有完全从我的系统中删除 gnuradio。
gnuradio 仍然可以在/usr/local/lib/python3/dist-packages 中找到,当我尝试运行 python 脚本时仍然会收到 ImportError。但是,现在当我输入head /usr/local/bin/gnuradio-companion 时,我收到以下消息:
head: cannot open '/usr/local/bin/gnuradio-companion' for reading: No such file or directory
which gnuradio-companion 的输出是:
/usr/bin/gnuradio-companion
我有点不知道现在在这里做什么。关于如何修复或完全卸载 gnuradio 的任何想法?
【问题讨论】:
标签: python-3.x linux path syntax-error gnuradio