# Drift Tube Example error: path = os.getenv('GARFIELD\_INSTALL') not working

**URL:** <https://root-forum.cern.ch/t/drift-tube-example-error-path-os-getenv-garfield-install-not-working/46112>\
**Category:** Garfield++\
**Created:** [August 1, 2021, 7:23am UTC](https://root-forum.cern.ch/t/drift-tube-example-error-path-os-getenv-garfield-install-not-working/46112 "2021-08-01T07:23:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![A.Sa](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/7ea924/32.png) [@A.Sa](https://root-forum.cern.ch/u/A.Sa)\
**Post date:** [August 1, 2021, 7:23am UTC](https://root-forum.cern.ch/t/drift-tube-example-error-path-os-getenv-garfield-install-not-working/46112/1 "2021-08-01T07:23:53Z")

</div>

Hello! I am attempting to get some plots from the Drift Tube example in Garfield++. I am using the python template available here: [Examples/GasFile/read.py · master · garfield / garfieldpp · GitLab](https://gitlab.cern.ch/garfield/garfieldpp/-/blob/master/Examples/GasFile/read.py) ; to make the plots. However, when I pass the command: path = os.getenv(‘GARFIELD\_INSTALL’) ; it returns ‘None’ for the path. I don’t understand why this is so, and would appreciate any help I can get. Thank you!

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [August 1, 2021, 4:47pm UTC](https://root-forum.cern.ch/t/drift-tube-example-error-path-os-getenv-garfield-install-not-working/46112/2 "2021-08-01T16:47:39Z")

</div>

Hi,  
you need to source the script `setupGarfield.sh` beforehand to set the `GARFIELD_INSTALL` environment variable.

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [August 15, 2021, 4:48pm UTC](https://root-forum.cern.ch/t/drift-tube-example-error-path-os-getenv-garfield-install-not-working/46112/3 "2021-08-15T16:48:09Z")

</div>

Closed on August 15, 2021, 4:48pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
