# Name Error for all codes

**URL:** <https://community.deeplearning.ai/t/name-error-for-all-codes/599530>\
**Category:** Supervised ML: Regression and Classification\
**Tags:** week-module-1, week-module-2\
**Created:** [March 27, 2024, 2:16pm UTC](https://community.deeplearning.ai/t/name-error-for-all-codes/599530 "2024-03-27T14:16:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Viraj\_Prabhu1](https://avatars.discourse-cdn.com/v4/letter/v/8e8cbc/32.png) [@Viraj\_Prabhu1](https://community.deeplearning.ai/u/Viraj_Prabhu1)\
**Post date:** [March 27, 2024, 2:16pm UTC](https://community.deeplearning.ai/t/name-error-for-all-codes/599530/1 "2024-03-27T14:16:43Z")

</div>

I am consistently getting a name error the codes I run in all the optional labs. It keeps showing the variable name used is not defined. Same thing happens for my assignment as well. Please do tell me a solution for this.

Thank you

---

<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:** [March 27, 2024, 2:32pm UTC](https://community.deeplearning.ai/t/name-error-for-all-codes/599530/2 "2024-03-27T14:32:26Z")

</div>

Are you running the lab in Coursera Labs? Or on another platform?

When you open the lab, you alway must run every cell starting from the top.

A screen capture image of your error would be helpful.
