# Relative path setting for loading data python script

**URL:** <https://discourse.slicer.org/t/relative-path-setting-for-loading-data-python-script/4084>\
**Category:** Development\
**Created:** [September 12, 2018, 3:19pm UTC](https://discourse.slicer.org/t/relative-path-setting-for-loading-data-python-script/4084 "2018-09-12T15:19:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saima](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@Saima](https://discourse.slicer.org/u/Saima)\
**Post date:** [September 12, 2018, 3:19pm UTC](https://discourse.slicer.org/t/relative-path-setting-for-loading-data-python-script/4084/1 "2018-09-12T15:19:23Z")

</div>

How to set relative path for loading Data using scripts in python slicer?

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [September 12, 2018, 3:31pm UTC](https://discourse.slicer.org/t/relative-path-setting-for-loading-data-python-script/4084/2 "2018-09-12T15:31:27Z")

</div>

Relative to what? Please be more specific.

There are paths in the object slicer.app, such as

```
slicer.app.slicerHome

```

You can concatenate the relative path to one of these.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [December 17, 2018, 2:16pm UTC](https://discourse.slicer.org/t/relative-path-setting-for-loading-data-python-script/4084/4 "2018-12-17T14:16:07Z")

</div>

_(See below a response that a user posted a few hours ago. Unfortunately, the response was flagged as spam - probably due to reviving a stale discussion and posting a short answer with a suspicious link - and I’ve made a mistake of confirming that this was a spam.)_

* * *

PYTHONPATH is used by the python interpreter to determine which modules to load.

[PATH](http://net-informations.com/python/intro/path.htm) is used by the shell to determine which executables to run.
