# Gate bindings for Slicer

**URL:** <https://discourse.slicer.org/t/gate-bindings-for-slicer/28794>\
**Category:** Support\
**Tags:** python, gate\
**Created:** [April 7, 2023, 10:26am UTC](https://discourse.slicer.org/t/gate-bindings-for-slicer/28794 "2023-04-07T10:26:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alex\_Vergara](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/alex_vergara/32/15205_2.png) [@Alex\_Vergara](https://discourse.slicer.org/u/Alex_Vergara)\
**Post date:** [April 7, 2023, 10:26am UTC](https://discourse.slicer.org/t/gate-bindings-for-slicer/28794/1 "2023-04-07T10:26:22Z")

</div>

I’m trying to use [Gate](https://github.com/OpenGATE/opengate) inside Slicer within my module [OpenDose3D](https://gitlab.com/opendose/opendose3d).

However, it’s being a bit difficult to install gate as a pip package.

```auto
slicer.util.pip_install("opengate")
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "C:\Users\alex.vergara.F-P-PHYS-02\AppData\Local\NA-MIC\Slicer 5.2.1\bin\Python\slicer\util.py", line 3571, in pip_install
    _executePythonModule('pip', args)
  File "C:\Users\alex.vergara.F-P-PHYS-02\AppData\Local\NA-MIC\Slicer 5.2.1\bin\Python\slicer\util.py", line 3533, in _executePythonModule
    logProcessOutput(proc)
  File "C:\Users\alex.vergara.F-P-PHYS-02\AppData\Local\NA-MIC\Slicer 5.2.1\bin\Python\slicer\util.py", line 3502, in logProcessOutput
    raise CalledProcessError(retcode, proc.args, output=proc.stdout, stderr=proc.stderr)
subprocess.CalledProcessError: Command '['C:/Users/alex.vergara.F-P-PHYS-02/AppData/Local/NA-MIC/Slicer 5.2.1/bin/../bin\\PythonSlicer.EXE', '-m', 'pip', 'install', 'opengate']' returned non-zero exit status 1.`

```

May someone guide me as why it does not install? I could maybe try to guide the Gate developers to build some wheel, but I don’t know if that will be enough.

EDIT: I have reported this issue in [gate page](https://github.com/OpenGATE/opengate/issues/146)

---

<div class="post-metadata">

**Author:** ![Alex\_Vergara](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/alex_vergara/32/15205_2.png) [@Alex\_Vergara](https://discourse.slicer.org/u/Alex_Vergara)\
**Post date:** [April 7, 2023, 8:02pm UTC](https://discourse.slicer.org/t/gate-bindings-for-slicer/28794/2 "2023-04-07T20:02:06Z")

</div>

In Linux opengate installs but when started it gave this error:

```auto
>>> import opengate as gate
opengate_core is not detected. Be sure to execute these lines before to run python:
export LD_LIBRARY_PATH=/home/alex/Programas/Slicer-5.3.0-2023-03-16-linux-amd64/bin/../lib/Python/lib/python3.9/site-packages/opengate_core.libs:${LD_LIBRARY_PATH}
export LD_PRELOAD=/home/alex/Programas/Slicer-5.3.0-2023-03-16-linux-amd64/bin/../lib/Python/lib/python3.9/site-packages/opengate_core.libs/libG4processes-9232ba54.so:/home/alex/Programas/Slicer-5.3.0-2023-03-16-linux-amd64/bin/../lib/Python/lib/python3.9/site-packages/opengate_core.libs/libG4geometry-fbd76286.so:${LD_PRELOAD}

```

Is there any way to set up these variables for Slicer?

---

<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:** [April 8, 2023, 8:39pm UTC](https://discourse.slicer.org/t/gate-bindings-for-slicer/28794/3 "2023-04-08T20:39:50Z")

</div>

Fixing the packaging of Gate is not really a feature request for Slicer but a bug report/feature request for Gate maintainers. I’ll change the category of the post accordingly (we can change it again if the discussion leads to the conclusion that there is some missing feature in Slicer).

Use Slicer-5.2.2 and try again, it may print more information about the error that occurred. You can also run `PythonSlicer -m pip install... ` to see more details.
