Skip to content
Advertisement

Tag: nameerror

What does NameError mean in python? [closed]

Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed last month. Improve this question I cannot get where my error is in my code. When I try to

NameError: name ‘__file__’ is not defined

I am trying to store the path of a script into a variable using: However, it keeps returning a name ‘__file__’ is not defined error. Answer Pretty sure you are running this in a terminal in the interactive Python as it is the only place (I’m aware of) to not have __file__. Also, if it was a script, and it

Advertisement