# Install python library with extension

**URL:** <https://discourse.slicer.org/t/install-python-library-with-extension/10110>\
**Category:** Development\
**Tags:** extensions-manager\
**Created:** [February 4, 2020, 5:55pm UTC](https://discourse.slicer.org/t/install-python-library-with-extension/10110 "2020-02-04T17:55:10Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![Davide\_Punzo](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/davide_punzo/32/66104_2.png) [@Davide\_Punzo](https://discourse.slicer.org/u/Davide_Punzo)\
**Post date:** [February 5, 2020, 8:59am UTC](https://discourse.slicer.org/t/install-python-library-with-extension/10110/8 "2020-02-05T08:59:59Z")

</div>

Ciao @PaoloZaffino, if your extension is in the extension manager, you can actually do it directly in the cmake (so they will be packed at compilation time on the kitware factory machines):

1. add python requirements in the superbuild:  
[https://github.com/Punzo/SlicerAstro/blob/master/SuperBuild.cmake#L28](https://github.com/Punzo/SlicerAstro/blob/master/SuperBuild.cmake#L28)  
[https://github.com/Punzo/SlicerAstro/blob/master/SuperBuild/slicerastro-requirements.txt](https://github.com/Punzo/SlicerAstro/blob/master/SuperBuild/slicerastro-requirements.txt)  
[https://github.com/Punzo/SlicerAstro/blob/master/SuperBuild/External\_python-slicerastro-requirements.cmake](https://github.com/Punzo/SlicerAstro/blob/master/SuperBuild/External_python-slicerastro-requirements.cmake)

2. ensure the packing directly in Slicer build:  
[https://github.com/Punzo/SlicerAstro/blob/master/CMakeLists.txt#L169-L176](https://github.com/Punzo/SlicerAstro/blob/master/CMakeLists.txt#L169-L176)

I tested this recently and it works. However, I tested only on linux.

P.S.: If you don’t have a SuperBuild, I advise to add it if you want to use this approach.

---

_[View the full topic](https://discourse.slicer.org/t/install-python-library-with-extension/10110)._
