# Using modules in LFortran Jupyter

**URL:** <https://fortran-lang.discourse.group/t/using-modules-in-lfortran-jupyter/4035>\
**Category:** Uncategorized\
**Created:** [July 20, 2022, 6:06pm UTC](https://fortran-lang.discourse.group/t/using-modules-in-lfortran-jupyter/4035 "2022-07-20T18:06:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![fedebenelli](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/fedebenelli/32/1823_2.png) [@fedebenelli](https://fortran-lang.discourse.group/u/fedebenelli)\
**Post date:** [July 20, 2022, 6:06pm UTC](https://fortran-lang.discourse.group/t/using-modules-in-lfortran-jupyter/4035/1 "2022-07-20T18:06:15Z")

</div>

Hello! I’m working in a refactoring project of my director’s codes, making everything into modules and derived types to make our programs more user-friendly. I’ve recently learned about LFortran and it’s Jupyter Kernel, I found it awesome and I would love to use my codes with that kind of interface.  
But I couldn’t find a way to `use` an already compiled module inside a notebook without pasting all the files contents into a cell and compiling in the notebook.  
Is there a way to achieve this?

tldr: I want to `use` my modules in a Jupyter Notebook like I would `import numpy as np` in a Python Kernel

---

<div class="post-metadata">

**Author:** ![Beliavsky](https://avatars.discourse-cdn.com/v4/letter/b/ba8739/32.png) [@Beliavsky](https://fortran-lang.discourse.group/u/Beliavsky)\
**Post date:** [July 20, 2022, 6:11pm UTC](https://fortran-lang.discourse.group/t/using-modules-in-lfortran-jupyter/4035/2 "2022-07-20T18:11:50Z")

</div>

This is the issue

> **[Load precompiled modules in interactive session (#588) · Issues · lfortran /...](https://gitlab.com/lfortran/lfortran/-/issues/588)**
>
> In R you often start a session with lines such as library(lib1)

@certik agreed that LFortran should have this capability.

---

<div class="post-metadata">

**Author:** ![certik](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/certik/32/4_2.png) [@certik](https://fortran-lang.discourse.group/u/certik)\
**Post date:** [July 21, 2022, 12:57am UTC](https://fortran-lang.discourse.group/t/using-modules-in-lfortran-jupyter/4035/3 "2022-07-21T00:57:08Z")

</div>

First of all, welcome @fedebenelli to the forum!

Currently, I think we can’t load modules in an interactive session, but we definitely want to. What you described is exactly what I want to do also.

Right now we are focusing on getting LFortran to compile more codes, we are doing very good progress. Once we can compile codes like yours, we will fix up these issues with interactivity.

---

<div class="post-metadata">

**Author:** ![fedebenelli](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/fedebenelli/32/1823_2.png) [@fedebenelli](https://fortran-lang.discourse.group/u/fedebenelli)\
**Post date:** [July 21, 2022, 1:32am UTC](https://fortran-lang.discourse.group/t/using-modules-in-lfortran-jupyter/4035/4 "2022-07-21T01:32:44Z")

</div>

Thank you! I’ve been reading a lot of threads here (I’ve started programming in Fortran about a year ago and a this forums as the whole fortran-lang site has been REALLY helpful).

I’m really glad of the work being made with LFortran, I think that interactivity is a key to ease the learning process for newcomers. But I do agree that extending the compiling capabilities should be a priority first

---

<div class="post-metadata">

**Author:** ![certik](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/certik/32/4_2.png) [@certik](https://fortran-lang.discourse.group/u/certik)\
**Post date:** [July 21, 2022, 3:09am UTC](https://fortran-lang.discourse.group/t/using-modules-in-lfortran-jupyter/4035/5 "2022-07-21T03:09:13Z")

</div>

Thanks, I am happy that you like it here. Indeed, I agree that interactivity is key. My goal is to get LFortran working with any code eventually, both interactively as well as compiling to binaries.
