![传入的位置无效,必须提供绝对路径?](https://linux22.com/image/1576344/%E4%BC%A0%E5%85%A5%E7%9A%84%E4%BD%8D%E7%BD%AE%E6%97%A0%E6%95%88%EF%BC%8C%E5%BF%85%E9%A1%BB%E6%8F%90%E4%BE%9B%E7%BB%9D%E5%AF%B9%E8%B7%AF%E5%BE%84%EF%BC%9F.png)
我正在尝试为 Redhawk 运行一个 Python 沙盒示例(https://redhawksdr.github.io/Documentation/mainch3.html#x5-270003.3)。我可以从 /usr/local/redhawk/ide/2.1.2 文件夹 (./eclipse) 启动 REDHAWK IDE。但是,当我运行以下命令时,出现错误:
>>> sb.IDELocation("/usr/local/redhawk/ide/2.1.2/eclipse")
IDELocation(): ERROR - invalid location passed in, must give absolute path
/usr/local/redhawk/ide/2.1.2/eclipse
如果我忽略这个“IDELocation(): ERROR”,执行 Plot() 命令时会出现以下问题:
>>> sb.IDELocation("/usr/local/redhawk/ide/2.1.2/eclipse")
IDELocation(): ERROR - invalid location passed in, must give absolute path
/usr/local/redhawk/ide/2.1.2/eclipse
>>> plot = sb.Plot()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/redhawk/core/lib/python/ossie/utils/sb/io_helpers.py",
line 1985, in __init__
raise AssertionError, "Plot():__init__() ERROR - must set environment
variable RH_IDE or call IDELocation()"
AssertionError: Plot():__init__() ERROR - must set environment variable
RH_IDE or call IDELocation()
有人知道如何解决此问题吗?提前致谢!
答案1
检查GITHub 源文件对于错误
IDELocation():错误 - 传入的位置无效,必须提供绝对路径
揭示如果在传入的绝对路径中找不到 eclipse,则会返回上述错误。因此,在您的情况下调用该函数的正确方法是:
sb.IDELocation("/usr/local/redhawk/ide/2.1.2/")