I have a weird python NameError that is confounding me, and completely stopping the work on the project I am working on. When I run the code on my machine running python 2.7.1 I get a NameError, but a coworker can run the code fine on his machine. The indentation is all spaces around the line the error occurs as well. Here’s the code
"""File: GatoTest.py"""
""" bunch of imports """
from Gato import *
def usage():
"""irrelevant code"""
app = AlgoWin()
And the code in Gato does include a class AlgoWin with an empty constructor
class AlgoWin(Frame):
def __init__(self, parent=None, graph_panes=None, paned=False, experimental=False):
"""irrelevant code"""
The error is thrown on the line app=AlgoWin(), and the exact message is
NameError: name ‘AlgoWin’ is not defined
I’m at a complete loss at this point, thanks in advance for any help or direction.
This seems like the import isn’t importing the right code. Try using
from Gato import AlgoWin(which is better practice anyway); you’ll probably get anImportErrorthere.Have you moved
Gato.py? Check for any stray.pycfiles that might be confusing the interpreter.