# Import slicer module in script cli module

**URL:** https://discourse.slicer.org/t/import-slicer-module-in-script-cli-module/37438
**Category:** Development
**Created:** [July 18, 2024, 2:43am UTC](https://discourse.slicer.org/t/import-slicer-module-in-script-cli-module/37438 "2024-07-18T02:43:39Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![fqzhice](https://avatars.discourse-cdn.com/v4/letter/f/7bcc69/32.png) [@fqzhice](https://discourse.slicer.org/u/fqzhice)
#### Post date: [July 18, 2024, 2:43am UTC](https://discourse.slicer.org/t/import-slicer-module-in-script-cli-module/37438/1 "2024-07-18T02:43:39Z")

</div>

I create a script cli module and call this script as below：

```auto
PythonQt::init();
PythonQtObjectPtr context = PythonQt::self()->getMainModule();

QString cmd = QString(
    "import os\n"
    "import sys\n"
    "CTASegExePath=slicer.app.slicerHome + '/CTAModule/lib/VesselCenterline.py'\n"
    "pythonSlicerExecutablePath=os.path.dirname(sys.executable)+'/PythonSlicer.exe'\n"
    "commandLine = [pythonSlicerExecutablePath, CTASegExePath]\n"
    "proc=slicer.util.launchConsoleProcess( commandLine ,useStartupEnvironment=True)\n"
    "slicer.util.logProcessOutput(proc)\n"
);  
context.evalScript(cmd);

```

in VesselCenterline.py scirpt

I cant import slicer module and call slicer python API, it says no module named “xxx”

How can i do about this ?
