# Execute python scripts not in a general linux terminal

**URL:** <https://discourse.slicer.org/t/execute-python-scripts-not-in-a-general-linux-terminal/32149>\
**Category:** Support\
**Created:** [October 11, 2023, 4:28am UTC](https://discourse.slicer.org/t/execute-python-scripts-not-in-a-general-linux-terminal/32149 "2023-10-11T04:28:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Liang\_Ma](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/liang_ma/32/66068_2.png) [@Liang\_Ma](https://discourse.slicer.org/u/Liang_Ma)\
**Post date:** [October 11, 2023, 4:28am UTC](https://discourse.slicer.org/t/execute-python-scripts-not-in-a-general-linux-terminal/32149/1 "2023-10-11T04:28:02Z")

</div>

Hi, there.  
I am able to run a python script inside 3D slicer Python consle, by following the suggestion from [here](https://discourse.slicer.org/t/running-python-script-in-slicer-in-linux/29124/3):

I am now trying to run the same script in a normal Linux terminal, however, since slicer is a package that does not exist outside of the 3D slicer install environment, always some errors are reported.

I also tried doing such: ./Slicer --no-splash --no-main-window --python-script “MY\_PYTHON” – this works somehow but still report some warning like below:

```auto
qSlicerMarkupsModulePrivate::addToolBar: no main window is available, toolbar is not added
qSlicerSequencesModulePrivate::addToolBar: no main window is available, toolbar is not added
Error ImageIO factory did not return an ImageIOBase: MRMLIDImageIO

```

Is there a way that I can run the Python script in a nominal Linux terminal?

---

<div class="post-metadata">

**Author:** ![Liang\_Ma](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/liang_ma/32/66068_2.png) [@Liang\_Ma](https://discourse.slicer.org/u/Liang_Ma)\
**Post date:** [October 11, 2023, 10:27am UTC](https://discourse.slicer.org/t/execute-python-scripts-not-in-a-general-linux-terminal/32149/2 "2023-10-11T10:27:38Z")

</div>

I don’t know why --but I can not modify my post now… actually just found the title is wrong-- it should be “Execute Python scripts in a generic Linux terminal”
