Are you sure you don't have to import os.path? I think you can get away with *just* importing os.path, but not just os...