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: Running script using Jython for DSS throws error "ImportError: No module named ti" on Ubuntu 22.04

Other Parts Discussed in Thread: CCSTUDIO, MSP430F5529, MSPM0G3507

Tool/software:

Hi Team,

I would like to run Jython script on CCS v20 as given in the below link -

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

Setup 

1. Install Jython on Ubuntu linux platform

apt-get install jython

2. JAVA_HOME

$ echo $JAVA_HOME
/<HOME>/ti/ccs1280/ccs/eclipse/jre

3. CLASSPATH

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

Execution

g$ jython script.py
Traceback (most recent call last):
File "script.py", line 3, in <module>
from com.ti.debug.engine.scripting import *
ImportError: No module named ti

Kindly let me know if anything needs to be modified/changed. 

Thanks,

Shriya

  • Hi Shriya,

    Can you clarify which version of CCS you are using? You mentioned CCS v20, but in the paths you are setting up, it looks like you might be using CCS v12 (ccs1280).

    Thanks,

    Ricky

  • Hi Ricky,

    Yes the version is CCS v12 (ccs1280).

    Regards,

    Shriya

  • Hi Shriya,

    Assuming JAVA_HOME and CLASSPATH are correct, one other thing to try is to install latest Jython from https://www.jython.org/download.html, i.e. jython-installer-2.7.4.jar

    I installed it in headless mode  using

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

    selected Standard installation and /usr/bin/jython as an install directory. You may have to select different directory if your previous Jython version is already installed there.

    Then I was able to successfully ran

    /usr/bin/jython/bin/jython $CCS_BASE_DIR/scripting/examples/DebugServerExamples/msp430f5529_breakpoints.js

    Thanks,

    Michael

  • Hi Michael,

    I uninstalled existing  jython file and followed the same procedure as you have mentioned above. Yes that issue is resolved. But stuck upon another issue .

    Steps -

    1. Installed latest version of jython on Ubuntu

    Congratulations! You successfully installed Jython 2.7.4 to directory /usr/bin/jython.

    2. Trying to run the script -

    /usr/bin/jython/bin/jython script.py
    traceSetFileLevel: ENTRY sLevel: ALL
    traceSetFileLevel: RETURN
    getServer: ENTRY sServerName: DebugServer.1
    getServer: Getting definition for: DebugServer.1
    getServer: Constructing server
    getServer: RETURN com.ti.debug.engine.scripting.DebugServer@16a5c7e4
    setConfig: ENTRY sConfigurationFile: mspm0g3507/mspm0g3507.ccxml
    setConfig: RETURN
    openSession: ENTRY sPattern: .*
    start: ENTRY
    start: Firing: onServerStarting()
    start: Connecting to XPCOM DebugServer
    start: Initializing DebugServer using specified configuration: "/<HOME>/ti/ccs1280/ccs/scripting/mspm0g3507/mspm0g3507.ccxml"
    waitUntil: ENTRY com.ti.ccstudio.scripting.environment.ScriptingEnvironment@800d065 timeout: 15000 (ms)
    waitUntil: RETURN com.ti.ccstudio.scripting.environment.ScriptingEnvironment@800d065
    SEVERE: Cannot read System Setup data from XML file /<HOME>/ti/ccs1280/ccs/scripting/mspm0g3507/mspm0g3507.ccxml
    Error parsing file:
    Fatal Error at (0, 0): An exception occurred! Type:RuntimeException, Message:The primary document entity could not be opened. Id=/<HOME>/ti/ccs1280/ccs/scripting/mspm0g3507/mspm0g3507.ccxml
    stop: ENTRY
    disposeAndUnload: Firing: onServerStopping()
    disposeAndUnload: Stopping DebugServer
    disposeAndUnload: Firing: onServerStopped()
    stop: RETURN
    SEVERE: Could not start server: DebugServer.1: Cannot read System Setup data from XML file /<HOME>/ti/ccs1280/ccs/scripting/mspm0g3507/mspm0g3507.ccxml
    Error parsing file:
    Fatal Error at (0, 0): An exception occurred! Type:RuntimeException, Message:The primary document entity could not be opened. Id=/<HOME>/ti/ccs1280/ccs/scripting/mspm0g3507/mspm0g3507.ccxml
    Traceback (most recent call last):
    File "script.py", line 23, in <module>
    debugSession = debugServer.openSession(".*")
    Error parsing file:

  • I have resolved this issue. The ticket can be closed