# How to add Setup file in 3D slicer's site-package?

**URL:** <https://discourse.slicer.org/t/how-to-add-setup-file-in-3d-slicers-site-package/29929>\
**Category:** Development\
**Created:** [June 9, 2023, 6:21am UTC](https://discourse.slicer.org/t/how-to-add-setup-file-in-3d-slicers-site-package/29929 "2023-06-09T06:21:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dsa934](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/dsa934/32/17907_2.png) [@dsa934](https://discourse.slicer.org/u/dsa934)\
**Post date:** [June 9, 2023, 6:21am UTC](https://discourse.slicer.org/t/how-to-add-setup-file-in-3d-slicers-site-package/29929/1 "2023-06-09T06:21:45Z")

</div>

Operating system: window 10  
Slicer version: 5.2.1

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/c/ac7858bc189275e0d6ce2900e205df7373db8cd5.png)

  
I created a setup.py to use all functions and classes declared in the whole project via "Import Total" declaration.

It works well as intended in my local, but to make it work well in slicer, can I put the setting of this setup file as slicer’s site-package?

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/6/1/614f017dec4376a238424b637b9b428c5f6a5d3c.png)

Shouldn’t I just add the packaging file I created to slicer’s site-package?

---

<div class="post-metadata">

**Author:** ![dsa934](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/dsa934/32/17907_2.png) [@dsa934](https://discourse.slicer.org/u/dsa934)\
**Post date:** [June 9, 2023, 7:39am UTC](https://discourse.slicer.org/t/how-to-add-setup-file-in-3d-slicers-site-package/29929/2 "2023-06-09T07:39:06Z")

</div>

```auto
# install my_python_package into 3d slicer
pip_install('SlicerPathTest-1.0.0-py3-none-any.whl')

# error log
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "C:\Users\LJW\AppData\Local\NA-MIC\Slicer 5.2.1\bin\Python\slicer\util.py", line 3571, in pip_install
    _executePythonModule('pip', args)
  File "C:\Users\LJW\AppData\Local\NA-MIC\Slicer 5.2.1\bin\Python\slicer\util.py", line 3533, in _executePythonModule
    logProcessOutput(proc)
  File "C:\Users\LJW\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/LJW/AppData/Local/NA-MIC/Slicer 5.2.1/bin/../bin\\PythonSlicer.EXE', '-m', 'pip', 'install', 'SlicerPathTest-1.0.0-py3-none-any.whl']' returned non-zero exit status 1.

```

I think this will solve the problem, but what should I do?

---

<div class="post-metadata">

**Author:** ![RafaelPalomar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rafaelpalomar/32/1436_2.png) [@RafaelPalomar](https://discourse.slicer.org/u/RafaelPalomar)\
**Post date:** [June 10, 2023, 9:59am UTC](https://discourse.slicer.org/t/how-to-add-setup-file-in-3d-slicers-site-package/29929/3 "2023-06-10T09:59:24Z")

</div>

This is probably due to a wrong path specification for the file  
`SlicerPathTest-1.0.0-py3-none-any.whl`. If you don’t specify the full path to  
the file, PythonSlicer will assume the file lies on the default working  
directory, which should be the path where the Slicer or PythonSlicer executable  
is. Try giving the full path to the file and let us know if it worked out.
