# How to run python .py file from windows terminal

**URL:** <https://discourse.slicer.org/t/how-to-run-python-py-file-from-windows-terminal/28740>\
**Category:** Support\
**Tags:** python\
**Created:** [April 4, 2023, 6:55am UTC](https://discourse.slicer.org/t/how-to-run-python-py-file-from-windows-terminal/28740 "2023-04-04T06:55:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mukund\_shah](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mukund_shah/32/18282_2.png) [@mukund\_shah](https://discourse.slicer.org/u/mukund_shah)\
**Post date:** [April 4, 2023, 6:55am UTC](https://discourse.slicer.org/t/how-to-run-python-py-file-from-windows-terminal/28740/1 "2023-04-04T06:55:25Z")

</div>

Slicer.exe --python-script “/full/path/to/myscript.py” --no-splash --no-main-window i am using this command in windows terminal but its showing error  
**The command Slicer.exe was not found, but does exist in the current location. Windows PowerShell does not load commands from the current location by default.**

I am going to place where my slicer exe file is i.e **C:\Users\mukun\AppData\Local\NA-MIC\Slicer 4.11.20210226** but its still not working ,kindly tell what am i doing wrong here?

---

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [April 4, 2023, 7:03am UTC](https://discourse.slicer.org/t/how-to-run-python-py-file-from-windows-terminal/28740/2 "2023-04-04T07:03:46Z")

</div>

Provide the full path to Slicer.exe between quotes in your script command or add the 3D Slicer home folder to your PATH variable (if you work on Windows).

---

<div class="post-metadata">

**Author:** ![mukund\_shah](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mukund_shah/32/18282_2.png) [@mukund\_shah](https://discourse.slicer.org/u/mukund_shah)\
**Post date:** [April 4, 2023, 7:05am UTC](https://discourse.slicer.org/t/how-to-run-python-py-file-from-windows-terminal/28740/3 "2023-04-04T07:05:01Z")

</div>

I did give this which is the full path r"E:\research\_ppr\slicer\_path\_to\_markup.py"

---

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [April 4, 2023, 7:12am UTC](https://discourse.slicer.org/t/how-to-run-python-py-file-from-windows-terminal/28740/4 "2023-04-04T07:12:51Z")

</div>

Add something like “C:\Users\yourname\AppData\Local\NA-MIC\Slicer 5.2.2\Slicer.exe”, depending on where you installed Slicer, to your script …

---

<div class="post-metadata">

**Author:** ![mukund\_shah](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mukund_shah/32/18282_2.png) [@mukund\_shah](https://discourse.slicer.org/u/mukund_shah)\
**Post date:** [April 4, 2023, 8:46am UTC](https://discourse.slicer.org/t/how-to-run-python-py-file-from-windows-terminal/28740/5 "2023-04-04T08:46:27Z")

</div>

Thanks ,the first only worked ,my mistake was I was not using command prompt of anaconda navigator
