# How can a new python library be added such as ast or astor in the python interpreter?

**URL:** <https://discourse.slicer.org/t/how-can-a-new-python-library-be-added-such-as-ast-or-astor-in-the-python-interpreter/5871>\
**Category:** Development\
**Created:** [February 21, 2019, 4:36pm UTC](https://discourse.slicer.org/t/how-can-a-new-python-library-be-added-such-as-ast-or-astor-in-the-python-interpreter/5871 "2019-02-21T16:36:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![carlos-luque](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/carlos-luque/32/976_2.png) [@carlos-luque](https://discourse.slicer.org/u/carlos-luque)\
**Post date:** [February 21, 2019, 4:36pm UTC](https://discourse.slicer.org/t/how-can-a-new-python-library-be-added-such-as-ast-or-astor-in-the-python-interpreter/5871/1 "2019-02-21T16:36:08Z")

</div>

Hello everyone  
I´m working the supporting the i18n for script modules, which was started in the 30th project week. In this process, the libraries _ast_ and _astor_ are utilited. The library ast is included in 3d Slicer, but the library astor is not included. I´d like to know how to add new libraries such as astor in the python interperter when the slicer is building.

Thanks in the advances.  
Carlos Luque

---

<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:** [February 21, 2019, 4:49pm UTC](https://discourse.slicer.org/t/how-can-a-new-python-library-be-added-such-as-ast-or-astor-in-the-python-interpreter/5871/2 "2019-02-21T16:49:32Z")

</div>

try this solution [Module for Internal Dosimetry in Nuclear Medicine](https://discourse.slicer.org/t/module-for-internal-dosimetry-in-nuclear-medicine/3317/14?u=alex_vergara)

basically at the end do

```auto
install_and_import('astor')

```

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [February 21, 2019, 6:16pm UTC](https://discourse.slicer.org/t/how-can-a-new-python-library-be-added-such-as-ast-or-astor-in-the-python-interpreter/5871/3 "2019-02-21T18:16:04Z")

</div>

> [@carlos-luque](#):
>
> the libraries _ast_ and _astor_ are utilited

This could be done like the other python library in Slicer. For example, see [https://github.com/Slicer/Slicer/blob/master/SuperBuild/External\_python-idna.cmake](https://github.com/Slicer/Slicer/blob/master/SuperBuild/External_python-idna.cmake)

---

<div class="post-metadata">

**Author:** ![carlos-luque](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/carlos-luque/32/976_2.png) [@carlos-luque](https://discourse.slicer.org/u/carlos-luque)\
**Post date:** [February 22, 2019, 3:14pm UTC](https://discourse.slicer.org/t/how-can-a-new-python-library-be-added-such-as-ast-or-astor-in-the-python-interpreter/5871/4 "2019-02-22T15:14:44Z")

</div>

Hello all,  
Thanks for your helps.  
I added the astor in 3D Slicer.
