# Course 2, Week 2 "ModuleNotFoundError" Error

**URL:** <https://community.deeplearning.ai/t/course-2-week-2-modulenotfounderror-error/25174>\
**Category:** Improving Deep Neural Networks: Hyperparameter tun\
**Tags:** coursera-platform\
**Created:** [August 4, 2021, 4:47pm UTC](https://community.deeplearning.ai/t/course-2-week-2-modulenotfounderror-error/25174 "2021-08-04T16:47:57Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![ckangai](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/ckangai/32/172807_2.png) [@ckangai](https://community.deeplearning.ai/u/ckangai)\
**Post date:** [August 4, 2021, 4:47pm UTC](https://community.deeplearning.ai/t/course-2-week-2-modulenotfounderror-error/25174/1 "2021-08-04T16:47:57Z")

</div>

When I execute the cell with the import statements that come as part of the notebook I get a “ModuleNotFoundError” error and it mentions “dlai\_tools”. This is an error in the provided notebook and not in my code. Can someone please fix this error please otherwise I cannot proceed? Here is the error message from executing the very first cell in the notebook:

 ![Capture](https://global.discourse-cdn.com/dlai/original/2X/1/17a56d34ccbca7eb13c48b833e28b0122d47f765.jpeg)

---

<div class="post-metadata">

**Author:** ![Tonny](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tonny/32/5415_2.png) [@Tonny](https://community.deeplearning.ai/u/Tonny)\
**Post date:** [August 6, 2021, 2:34pm UTC](https://community.deeplearning.ai/t/course-2-week-2-modulenotfounderror-error/25174/2 "2021-08-06T14:34:17Z")

</div>

I have the same problem. Do you figure out how to deal with it?

---

<div class="post-metadata">

**Author:** ![ckangai](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/ckangai/32/172807_2.png) [@ckangai](https://community.deeplearning.ai/u/ckangai)\
**Post date:** [August 6, 2021, 5:39pm UTC](https://community.deeplearning.ai/t/course-2-week-2-modulenotfounderror-error/25174/3 "2021-08-06T17:39:44Z")

</div>

It was okay when I went back to try it a day later. I think the content developer had taken out the module, maybe for further development, and I wish they would tell us when they pull out a module like that. I finished my assignment. Maybe they have pulled it out again.

---

<div class="post-metadata">

**Author:** ![nramon](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/nramon/32/129097_2.png) [@nramon](https://community.deeplearning.ai/u/nramon)\
**Post date:** [August 7, 2021, 10:34am UTC](https://community.deeplearning.ai/t/course-2-week-2-modulenotfounderror-error/25174/4 "2021-08-07T10:34:12Z")

</div>

Glad it’s working for you, @ckangai.

You could try [updating](https://community.deeplearning.ai/t/how-to-get-a-clean-copy-of-an-assignment-notebook/73) the notebook, @Tonny.

---

<div class="post-metadata">

**Author:** ![Tonny](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tonny/32/5415_2.png) [@Tonny](https://community.deeplearning.ai/u/Tonny)\
**Post date:** [August 7, 2021, 2:10pm UTC](https://community.deeplearning.ai/t/course-2-week-2-modulenotfounderror-error/25174/5 "2021-08-07T14:10:08Z")

</div>

Thank you!~ I just finish the assignment and found that the problem only comes out in sometime (not always). Anyway, It seem to have been repaired!~ 😁

---

<div class="post-metadata">

**Author:** ![LuckyLolo123](https://avatars.discourse-cdn.com/v4/letter/l/a88e57/32.png) [@LuckyLolo123](https://community.deeplearning.ai/u/LuckyLolo123)\
**Post date:** [August 11, 2021, 4:14am UTC](https://community.deeplearning.ai/t/course-2-week-2-modulenotfounderror-error/25174/6 "2021-08-11T04:14:21Z")

</div>

The same problem, I updated the file, and still the same.

---

<div class="post-metadata">

**Author:** ![mnechromancer](https://avatars.discourse-cdn.com/v4/letter/m/f14d63/32.png) [@mnechromancer](https://community.deeplearning.ai/u/mnechromancer)\
**Post date:** [August 11, 2021, 1:36pm UTC](https://community.deeplearning.ai/t/course-2-week-2-modulenotfounderror-error/25174/7 "2021-08-11T13:36:31Z")

</div>

I’m having this issue as well. Can’t even start the exercise.

---

<div class="post-metadata">

**Author:** ![mnechromancer](https://avatars.discourse-cdn.com/v4/letter/m/f14d63/32.png) [@mnechromancer](https://community.deeplearning.ai/u/mnechromancer)\
**Post date:** [August 11, 2021, 1:40pm UTC](https://community.deeplearning.ai/t/course-2-week-2-modulenotfounderror-error/25174/8 "2021-08-11T13:40:41Z")

</div>

Just found the fix. Look at the “how to refresh your workspace” exercise in the course.

---

<div class="post-metadata">

**Author:** ![mnechromancer](https://avatars.discourse-cdn.com/v4/letter/m/f14d63/32.png) [@mnechromancer](https://community.deeplearning.ai/u/mnechromancer)\
**Post date:** [August 11, 2021, 1:56pm UTC](https://community.deeplearning.ai/t/course-2-week-2-modulenotfounderror-error/25174/9 "2021-08-11T13:56:15Z")

</div>

The key is renaming the file. Note that the grader also only accepts a file with the original file name so you’ll have to rename the file AGAIN (back to the original).

---

<div class="post-metadata">

**Author:** ![paulinpaloalto](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/paulinpaloalto/32/187_2.png) [@paulinpaloalto](https://community.deeplearning.ai/u/paulinpaloalto)\
**Post date:** [August 11, 2021, 4:11pm UTC](https://community.deeplearning.ai/t/course-2-week-2-modulenotfounderror-error/25174/10 "2021-08-11T16:11:12Z")

</div>

All good points! The other thing to remember is you need to delete all the “dot py” files e.g. _public\_tests.py_ when you do the “refresh” in order to make sure you get the new versions.

All that is mentioned on the relevant topic on the [FAQ Thread](https://community.deeplearning.ai/t/faq-frequently-asked-questions-for-dls-course-1/74).

---

<div class="post-metadata">

**Author:** ![LuckyLolo123](https://avatars.discourse-cdn.com/v4/letter/l/a88e57/32.png) [@LuckyLolo123](https://community.deeplearning.ai/u/LuckyLolo123)\
**Post date:** [August 12, 2021, 4:26am UTC](https://community.deeplearning.ai/t/course-2-week-2-modulenotfounderror-error/25174/11 "2021-08-12T04:26:54Z")

</div>

that didn’t work for me, it’s the second time that happens to me and I think I have to wait until the next day, like yesterday. Because today I have that kind of error trying to call another function in the exercise 2, and when I run the python notebook again, the error appeared in the import section again

---

<div class="post-metadata">

**Author:** ![Francis60](https://avatars.discourse-cdn.com/v4/letter/f/e95f7d/32.png) [@Francis60](https://community.deeplearning.ai/u/Francis60)\
**Post date:** [April 11, 2024, 6:42pm UTC](https://community.deeplearning.ai/t/course-2-week-2-modulenotfounderror-error/25174/12 "2024-04-11T18:42:53Z")

</div>

Hi all ,  
I had same issue with the locally missing `dlai_tools` package and solved it this way on poetry environment:

> poetry add dlai\_tools

For (ana/mini)conda environments:

> conda install dlia\_tools

using PyPi:

> pip install dlai\_tools

From Jupyter notebook:

> !pip install dlai\_tools

@ckangai I hope you succeeded your course by now. 😉

I wish this would help.  
Bye

---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [April 11, 2024, 6:55pm UTC](https://community.deeplearning.ai/t/course-2-week-2-modulenotfounderror-error/25174/13 "2024-04-11T18:55:10Z")

</div>

The dlai\_tools package is not distributed with the notebook files - it’s an external package.

I believe this is a unique situation for this particular lab.

---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [April 11, 2024, 6:55pm UTC](https://community.deeplearning.ai/t/course-2-week-2-modulenotfounderror-error/25174/14 "2024-04-11T18:55:19Z")

</div>


