# Are extension packages importable?

**URL:** <https://discourse.julialang.org/t/are-extension-packages-importable/92527>\
**Category:** General Usage\
**Tags:** package-extensions\
**Created:** [January 4, 2023, 9:15pm UTC](https://discourse.julialang.org/t/are-extension-packages-importable/92527 "2023-01-04T21:15:14Z")\
**Posts on this page:** 1\
**Showing post:** 19

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [April 21, 2023, 6:59am UTC](https://discourse.julialang.org/t/are-extension-packages-importable/92527/19 "2023-04-21T06:59:40Z")

</div>

You cannot have `ext = Base.get_extension(@ __MODULE__ , :Extension)` outside the macro expansion, it needs to be inside the returned expression.

Extensions are a run time thing, they might be loaded or they might not be so you have to check. Therefore, you cannot make a decision about them during precompile time (or macro expansion time). That’s why you need to run some code (like a function) to interact with them and you cannot really just export a type from it.

---

_[View the full topic](https://discourse.julialang.org/t/are-extension-packages-importable/92527)._
