This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] CCSTUDIO3:使用 Jython 运行 DSS 的脚本会抛出错误"ImportError:在 Ubuntu 22.04上没有名为 ti"的模块

Guru**** 2465890 points
Other Parts Discussed in Thread: CCSTUDIO, MSP430F5529, MSPM0G3507

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1493002/ccstudio3-running-script-using-jython-for-dss-throws-error-importerror-no-module-named-ti-on-ubuntu-22-04

主题中讨论的其他器件:CCStudioMSP430F5529MSPM0G3507

工具与软件:

大家好、团队成员:

我想在 CCS v20上运行以下链接中给出的 Jython 脚本-

https://software-dl.ti.com/ccs/esd/documents/dss_python_dss_scripting.html

消息  

1.在 Ubuntu Linux 平台上安装 Jython

apt-get install Jython

2. java_home

$ echo $java_home
/ /ti/ccs1280/ccs/eclipse/jre

3.类路径

$ echo $CLASSPATH
/ /ti/ccs1280/ccs/ccs_base/DebugServer/packages/ti/dss/java/dss.jar:/ /ti/ccs1280/ccs/ccs_base/DebugServer/packages/ti/dss/java/com.ti.ccstudio.scripting.environment_3.1.0.jar:/ /ti/ccs1280/ccs/ccs_base/DebugServer/packages/ti/dss/java/com.ti.debug.engine_1.0.0.jar

执行

G$ Jython script.py
回溯(最近的呼叫最后):
文件"script.py"、第3行(在中)
从 com.ti.debug.engine.scripting 导入*
ImportError:没有名为 ti 的模块

如果有任何需要修改/更改的地方、敬请告知。  

谢谢!

Shriya

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Shriya:

    您能说明一下您使用的是哪个版本的 CCS 吗? 您提到了 CCS v20、但在您设置的路径中、似乎您正在使用 CCS v12 (ccs1280)。

    谢谢!

    Ricky

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Ricky:

    是的、版本为  CCS v12 (ccs1280)。

    此致、

    Shriya

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Shriya:

    假设 JAVA_HOME 和 CLASSPATH 正确、另一件事是从 https://www.jython.org/download.html 安装最新的 Jython、即 jython-installer-2.7.4.jar

    我 使用将其安装在无头模式下

    sudo $CCS_INSTALL_DIR/CCS/eclipse/jre/bin/java -jar jython-installer-2.7.4.jar

    选择标准安装和/usr/bin/jython 作为安装目录。 如果之前的 Jython 版本已安装、则可能需要选择其他目录。

    然后我成功地跑了

    /usr/bin/jython/bin/jython $CCS_BASE_DIR/scripting/Examples/DebugServerExampls/msp430f5529_breakpoints.js

    谢谢!

    Michael

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Michael:

    我卸载了现有的 Jython 文件并按照上面提到的相同过程进行操作。 是的、该问题已解决。 但停留在另一个问题.

    步骤-

    1.在 Ubuntu 上安装了最新版本的 Jython

    恭喜! 您已成功将 Jython 2.7.4安装到/usr/bin/jython.目录中

    2.尝试运行脚本-

    /usr/bin/jython/bin/jython script.py
    traceSetFileLevel:条目 sLevel:all
    traceSetFileLevel:返回
    getServer:条目 sServerName: DebugServer.1
    getServer:获取定义: DebugServer.1
    getServer:正在构建服务器
    getServer:返回 com.ti.debug.engine.scripting.DebugServer@16a5c7e4
    setConfig:条目 sConfigurationFile:mspm0g3507/mspm0g3507.ccxml
    setConfig:返回
    openSession:条目 sPattern:.*
    开始:进入
    开始:触发: onServerStarting()
    开始:连接到 XPCOM DebugServer
    start:使用指定的配置初始化 DebugServer:"/ /ti/ccs1280/ccs/scripting/mspm0g3507/mspm0g3507.ccxml
    waitUntil:entry com.ti.ccstudio。scripting.environment.ScriptingEnvironment@800d065超时:15000 (ms)
    waitUntil:返回 com.ti.ccstudio。scripting.environment.ScriptingEnvironment@800d065
    严重:无法从 XML 文件读取系统设置程序数据/ /ti/ccs1280/ccs/scripting/mspm0g3507/mspm0g3507.ccxml
    解析文件时出错:
    致命错误(0、0):发生异常! 类型:RuntimeException、消息:无法打开主文档实体。 Id=/ /ti/ccs1280/ccs/scripting/mspm0g3507/mspm0g3507.ccxml
    停止:进入
    DisposeAndUnload:触发: onServerStopping ()
    disposeAndUnload:停止 DebugServer
    DisposeAndUnload:触发: onServerStopped()
    停止:返回
    严重:无法启动服务器: DebugServer.1:无法从 XML 文件/读取系统设置数据 /ti/ccs1280/ccs/scripting/mspm0g3507/mspm0g3507.ccxml
    解析文件时出错:
    致命错误(0、0):发生异常! 类型:RuntimeException、消息:无法打开主文档实体。 Id=/ /ti/ccs1280/ccs/scripting/mspm0g3507/mspm0g3507.ccxml
    回溯(最近的呼叫最后):
    文件"script.py"第23行(在中)
    debugSession = debugServer.openSession (".*")
    解析文件时出错:

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我已经解决了这个问题。 可以关闭机票