# Jupyter lab notebook \`No Module Named\` error upon importing installed packages

**URL:** <https://discourse.jupyter.org/t/jupyter-lab-notebook-no-module-named-error-upon-importing-installed-packages/26875>\
**Category:** JupyterLab\
**Tags:** jupyterlab, help-wanted, notebook\
**Created:** [July 11, 2024, 8:05am UTC](https://discourse.jupyter.org/t/jupyter-lab-notebook-no-module-named-error-upon-importing-installed-packages/26875 "2024-07-11T08:05:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Utkarsh736](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/utkarsh736/32/13311_2.png) [@Utkarsh736](https://discourse.jupyter.org/u/Utkarsh736)\
**Post date:** [July 11, 2024, 8:05am UTC](https://discourse.jupyter.org/t/jupyter-lab-notebook-no-module-named-error-upon-importing-installed-packages/26875/1 "2024-07-11T08:05:02Z")

</div>

Hey everyone,

I’m getting a `no module named` error for installed packages.

Earlier I was using `nbdev` package installed locally (not virtual environment). Although the `nbdev` commands were working in my terminal and jupyter lab terminal as desired, I got the `no module named` when importing `nbdev` in the notebook.  
Assuming it to be a package issue, I let it be.

Now again, for a different project, I’m getting the same issue when importing packages such as `fastai`, `torch`, and `keras` in both virtual and local environments where they are installed;

Even after doing a `!pip install` in the notebook, I get the same error.

At the same time and environment, I can import libraries/packages such as `pandas`, or `numpy`.

What may be the issue, and how may I resolve it?

Thank you.

---

<div class="post-metadata">

**Author:** ![roydotchen](https://avatars.discourse-cdn.com/v4/letter/r/b3f665/32.png) [@roydotchen](https://discourse.jupyter.org/u/roydotchen)\
**Post date:** [July 11, 2024, 2:43pm UTC](https://discourse.jupyter.org/t/jupyter-lab-notebook-no-module-named-error-upon-importing-installed-packages/26875/2 "2024-07-11T14:43:30Z")

</div>

I resolved this kind of issue by granting 755 permission on site-packages folder and subfolder

---

<div class="post-metadata">

**Author:** ![fomightez](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/fomightez/32/495_2.png) [@fomightez](https://discourse.jupyter.org/u/fomightez)\
**Post date:** [July 11, 2024, 2:46pm UTC](https://discourse.jupyter.org/t/jupyter-lab-notebook-no-module-named-error-upon-importing-installed-packages/26875/3 "2024-07-11T14:46:04Z")

</div>

> [@Utkarsh736](#):
>
> Even after doing a `!pip install` in the notebook, I get the same error.

For a better experience in modern Jupyter, you should shift to using the more current `%pip install` when attempting to do installations from inside a running Jupyter `.ipynb` file. That ensures the commands target the environment where the kernel backing the notebook is running. The exclamation point used in conjunction with install commands doesn’t do that and so it may lead to unexpected outcomes.

See more about the modern `%pip install` command [here](https://discourse.jupyter.org/t/why-users-can-install-modules-from-pip-but-not-from-conda/10722/4) **added in 2019** for a better experience with such installs performed from in a cell inside a running notebook. [The second paragraph here](https://discourse.jupyter.org/t/location-of-libraries-or-extensions-installed-in-jupyterlab/16303/2) goes into more details about why the exclamation point may lead to issues.

This likely will not have any effect in your current situation, yet it will pay dividends later going forward in your Jupyter experience wherever you use modern Jupyter as it works in JupyterLite and even Google Colab now.

---

<div class="post-metadata">

**Author:** ![Utkarsh736](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/utkarsh736/32/13311_2.png) [@Utkarsh736](https://discourse.jupyter.org/u/Utkarsh736)\
**Post date:** [July 11, 2024, 3:20pm UTC](https://discourse.jupyter.org/t/jupyter-lab-notebook-no-module-named-error-upon-importing-installed-packages/26875/4 "2024-07-11T15:20:48Z")

</div>

Oh nice, I wasn’t aware that magic commands for `pip` and `conda` were a thing; will keep them in mind going forward.

---

<div class="post-metadata">

**Author:** ![Utkarsh736](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/utkarsh736/32/13311_2.png) [@Utkarsh736](https://discourse.jupyter.org/u/Utkarsh736)\
**Post date:** [July 11, 2024, 3:22pm UTC](https://discourse.jupyter.org/t/jupyter-lab-notebook-no-module-named-error-upon-importing-installed-packages/26875/5 "2024-07-11T15:22:40Z")

</div>

What sort of permission, and how to grant them?
