# Help needed - Context Engineering course - python interpreter not able to fetch linked libraries

**URL:** <https://community.deeplearning.ai/t/help-needed-context-engineering-course-python-interpreter-not-able-to-fetch-linked-libraries/896665>\
**Category:** AI Discussions\
**Tags:** ai-discussions\
**Created:** [November 30, 2026, 6:38am UTC](https://community.deeplearning.ai/t/help-needed-context-engineering-course-python-interpreter-not-able-to-fetch-linked-libraries/896665 "2026-11-30T06:38:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rghoshal](https://avatars.discourse-cdn.com/v4/letter/r/e0b2c6/32.png) [@rghoshal](https://community.deeplearning.ai/u/rghoshal)\
**Post date:** [November 30, 2026, 6:38am UTC](https://community.deeplearning.ai/t/help-needed-context-engineering-course-python-interpreter-not-able-to-fetch-linked-libraries/896665/1 "2026-11-30T06:38:06Z")

</div>

**Hi ,**

I was working through assignments for Context Engineering course. But i am getting python error in compiling the code for graded assignment in Module 2. It seems to be linkage issues -  
NameError Traceback (most recent call last)  
Cell In[4], line 3  
1 from collections import Counter  
----\> 3 metas = COLLECTION.get(include=[“metadatas”])[“metadatas”]  
4 print(“Total chunks:”, len(metas))  
5 print(dict(Counter(m[“chunk\_type”] for m in metas)))

NameError: name ‘COLLECTION’ is not defined

I restarted the kernel and reran all the blocks … but to no effect… Can you pls help me what am i missing here ?  
Best Regards,  
Rajat

---

<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:** [November 30, 2026, 6:56am UTC](https://community.deeplearning.ai/t/help-needed-context-engineering-course-python-interpreter-not-able-to-fetch-linked-libraries/896665/2 "2026-11-30T06:56:44Z")

</div>

Please post your question in the Q&A forum area for that course.

That will provide a better chance for a mentor for that course to discover your question.

---

<div class="post-metadata">

**Author:** ![gent.spah](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/gent.spah/32/136423_2.png) [@gent.spah](https://community.deeplearning.ai/u/gent.spah)\
**Post date:** [November 30, 2026, 7:11am UTC](https://community.deeplearning.ai/t/help-needed-context-engineering-course-python-interpreter-not-able-to-fetch-linked-libraries/896665/3 "2026-11-30T07:11:21Z")

</div>

First, as Tom suggested, please make sure you post your question in the appropriate course discussion area so that the relevant course team and other learners can also assist.

Regarding the error, `NameError: name 'COLLECTION' is not defined` means that Python cannot find a variable named `COLLECTION` in the current execution environment.

A couple of things to check:

1. Have you modified or overwritten any of the original code in the notebook? `COLLECTION` should be defined in one of the earlier cells. Make sure you have executed the cell that initializes it before running the cell that accesses it.

2. If you have accidentally modified the original notebook code, try restoring the original version. On the DeepLearning.AI platform, you can usually do this through the three-dot menu. On Coursera, look for the reset option under the question-mark menu (usually in the top-right corner).

Restarting the kernel and rerunning all cells will not resolve the issue if the initialization code is missing or has been modified.

I would suggest first restoring the original notebook and running the cells in sequence without modifying the provided code.

---

<div class="post-metadata">

**Author:** ![rghoshal](https://avatars.discourse-cdn.com/v4/letter/r/e0b2c6/32.png) [@rghoshal](https://community.deeplearning.ai/u/rghoshal)\
**Post date:** [November 30, 2026, 9:36am UTC](https://community.deeplearning.ai/t/help-needed-context-engineering-course-python-interpreter-not-able-to-fetch-linked-libraries/896665/4 "2026-11-30T09:36:07Z")

</div>

Thank you very much. Will do.

Best Regards,  
Rajat

Someone replied to your post.

> ![](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/45/9321_2.png "TMosh") | [TMosh](https://community.deeplearning.ai/u/tmosh) Super Mentor - DLS  
> November 30 |
> 
> - | - |

Please post your question in the Q&A forum area for that course.

That will provide a better chance for a mentor for that course to discover your question.

---

<div class="post-metadata">

**Author:** ![rghoshal](https://avatars.discourse-cdn.com/v4/letter/r/e0b2c6/32.png) [@rghoshal](https://community.deeplearning.ai/u/rghoshal)\
**Post date:** [November 30, 2026, 9:37am UTC](https://community.deeplearning.ai/t/help-needed-context-engineering-course-python-interpreter-not-able-to-fetch-linked-libraries/896665/5 "2026-11-30T09:37:15Z")

</div>

Thank you very much . Will do.

Best Regards,  
Rajat

Someone replied to your post.

> ![](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/gent.spah/45/136423_2.png "gent.spah") | [gent.spah](https://community.deeplearning.ai/u/gent.spah) GenAI Mentor  
> November 30 |
> 
> - | - |

First, as Tom suggested, please make sure you post your question in the appropriate course discussion area so that the relevant course team and other learners can also assist.

Regarding the error, `NameError: name 'COLLECTION' is not defined` means that Python cannot find a variable named `COLLECTION` in the current execution environment.

A couple of things to check:

1. Have you modified or overwritten any of the original code in the notebook? `COLLECTION` should be defined in one of the earlier cells. Make sure you have executed the cell that initializes it before running the cell that accesses it.

2. If you have accidentally modified the original notebook code, try restoring the original version. On the DeepLearning.AI platform, you can usually do this through the three-dot menu. On Coursera, look for the reset option under the question-mark menu (usually in the top-right corner).

Restarting the kernel and rerunning all cells will not resolve the issue if the initialization code is missing or has been modified.

I would suggest first restoring the original notebook and running the cells in sequence without modifying the provided code.

---

<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:** [November 30, 2026, 3:31pm UTC](https://community.deeplearning.ai/t/help-needed-context-engineering-course-python-interpreter-not-able-to-fetch-linked-libraries/896665/6 "2026-11-30T15:31:13Z")

</div>

Gent has given you some great pointers about what to look for. Another possible mistake is changing the type of the code cell that defines `COLLECTION` to be “Markdown” instead of “Code”. That would mean that it becomes non-executable. Use the search function (“`^F`”) to find all instances of `COLLECTION` in the notebook. Is there a cell that defines it? Are you sure that the cell type is “Code”? Click “`Cell -> Cell Type`” to see …

Of course getting a fresh copy, as Gent suggested, is a good way to fix that problem, but it’s also pretty easy to fix once you find the menu item I listed above. 🤓

---

<div class="post-metadata">

**Author:** ![rghoshal](https://avatars.discourse-cdn.com/v4/letter/r/e0b2c6/32.png) [@rghoshal](https://community.deeplearning.ai/u/rghoshal)\
**Post date:** [November 30, 2026, 4:41pm UTC](https://community.deeplearning.ai/t/help-needed-context-engineering-course-python-interpreter-not-able-to-fetch-linked-libraries/896665/7 "2026-11-30T16:41:09Z")

</div>

Thank you very much Paul. Will do.

Best Regards,  
Rajat

Someone replied to your post.

> ![](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/paulinpaloalto/45/187_2.png "paulinpaloalto") | [paulinpaloalto](https://community.deeplearning.ai/u/paulinpaloalto) DLS Mentor  
> November 30 |
> 
> - | - |

Gent has given you some great pointers about what to look for. Another possible mistake is changing the type of the code cell that defines `COLLECTION` to be “Markdown” instead of “Code”. That would mean that it becomes non-executable. Use the search function (“`^F`”) to find all instances of `COLLECTION` in the notebook. Is there a cell that defines it? Are you sure that the cell type is “Code”? Click “`Cell -> Cell Type`” to see …

Of course getting a fresh copy, as Gent suggested, is a good way to fix that problem, but it’s also pretty easy to fix once you find the menu item I listed above. ![:nerd_face:](https://emoji.discourse-cdn.com/google/nerd_face.png?v=16 ":nerd\_face:")
