# Issue when build an extension

**URL:** <https://discourse.slicer.org/t/issue-when-build-an-extension/30695>\
**Category:** Development\
**Created:** [July 20, 2023, 3:21am UTC](https://discourse.slicer.org/t/issue-when-build-an-extension/30695 "2023-07-20T03:21:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![haphantran](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/haphantran/32/18446_2.png) [@haphantran](https://discourse.slicer.org/u/haphantran)\
**Post date:** [July 20, 2023, 3:21am UTC](https://discourse.slicer.org/t/issue-when-build-an-extension/30695/1 "2023-07-20T03:21:58Z")

</div>

Hi all,  
We’re trying to build the extension and publish it to extension Manager.  
It’s a Python base extension and I’m following the steps in this link for Windows.  
[Extensions — 3D Slicer documentation](https://slicer.readthedocs.io/en/latest/developer_guide/extensions.html#windows)  
I’m having trouble understand this step:  
`* Specify `Slicer\_DIR`by replacing`Slicer\_DIR-NOTFOUND`by the Slicer inner-build folder (for example`c:/D/SD/Slicer-build`).`  
I think it is required to build Slicer from source code, but in another part of the doc, we have this:

```auto
If developing modules in Python only, then it is not necessary to build the extension.

```

So do I need to build Slicer from source code?  
I was trying to do it but couldn’t find the link to download and setup qt correctly.  
Please help on this topic.  
Thank you!!!

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [July 20, 2023, 1:02pm UTC](https://discourse.slicer.org/t/issue-when-build-an-extension/30695/2 "2023-07-20T13:02:20Z")

</div>

As I recall, you need to have a fully built local Slicer in order to package an extension for redistribution, but if you are just developing and only using python you don’t need that step. If your are going to submit to the slicer extension index then packaging will happen on the Slicer factory machine build trees.

---

<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:** [July 20, 2023, 1:28pm UTC](https://discourse.slicer.org/t/issue-when-build-an-extension/30695/3 "2023-07-20T13:28:11Z")

</div>

> [@haphantran](#):
>
> > `If developing modules in Python only, then it is not necessary to build the extension.`

This note is in the [Build an extension section](https://slicer.readthedocs.io/en/latest/developer_guide/extensions.html#build-an-extension) of the documentation and means that you can _develop, use, and test_ Python modules without building anything. However, if you want to build and extension package, you still need to built Slicer, as the packaging infrastructure relies on having a complete build tree of Slicer.

I agree that it would be nice to have a way to create packages of Python-only extensions. Feel free to submit a feature request for this (by creating a new topic in the [Feature requests](https://discourse.slicer.org/c/support/feature-requests/9) category) and as more people vote on it, it will get higher on the priority list.

---

<div class="post-metadata">

**Author:** ![haphantran](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/haphantran/32/18446_2.png) [@haphantran](https://discourse.slicer.org/u/haphantran)\
**Post date:** [July 21, 2023, 4:15am UTC](https://discourse.slicer.org/t/issue-when-build-an-extension/30695/4 "2023-07-21T04:15:00Z")

</div>

Thank you for the answer. I’m trying to download Qt 5.15.2 but not sure which one I should download from this list. Can you comment on that?

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

---

<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:** [July 21, 2023, 4:32am UTC](https://discourse.slicer.org/t/issue-when-build-an-extension/30695/5 "2023-07-21T04:32:00Z")

</div>

Based on the screenshot, it looks you are on a web page regarding embedded linux, instead I suggest you do the following:

1. Go to [Build Instructions — 3D Slicer documentation](https://slicer.readthedocs.io/en/latest/developer_guide/build_instructions/index.html)
2. Click on the `Install prerequisites` or `Prerequisites` corresponding to your platform
3. Click on the link related to Qt

---

<div class="post-metadata">

**Author:** ![haphantran](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/haphantran/32/18446_2.png) [@haphantran](https://discourse.slicer.org/u/haphantran)\
**Post date:** [July 25, 2023, 7:36pm UTC](https://discourse.slicer.org/t/issue-when-build-an-extension/30695/6 "2023-07-25T19:36:24Z")

</div>

Thank you Jean.  
I followed the instruction on the link, for Qt, here is the screenshot. Slicer required Qt 5.15.2.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/9/9/99ef4af026d8557a2123e5c4309b6b2f99d1d5a0.png)  
The link get me to Online Qt installer, which is currently Qt version 6 only.  
For offline installer, they only provided link for 5.14 and lower, as per this annoucement.  
[download.qt.io/archive/qt/5.15/5.15.2/OFFLINE\_README.txt](https://download.qt.io/archive/qt/5.15/5.15.2/OFFLINE_README.txt)  
Do you or anyone have the offline installer for Qt 5.15?

---

<div class="post-metadata">

**Author:** ![haphantran](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/haphantran/32/18446_2.png) [@haphantran](https://discourse.slicer.org/u/haphantran)\
**Post date:** [July 25, 2023, 7:55pm UTC](https://discourse.slicer.org/t/issue-when-build-an-extension/30695/7 "2023-07-25T19:55:33Z")

</div>

Correction from this post: The current online installer has 5.15 and Qt 6.xx. I will try this and update you guys if successful.
