How should I be importing the loader to load models+textures

Right now I’m doing this:

from direct.showbase.Loader import Loader as loader 

And I’m loading a texture like this:

sometexture = loader.loadTexture('somefile.jpg', 'somefile.rgb')

Its giving me this error:

TypeError: unbound method loadTexture() must be called with Loader instance as first argument (got str instance instead)

What is the correct way to load it in? I’m using Panda3D-1.8.1

import direct.directbase.DirectStart

def main():

    sometexture = loader.loadTexture('somefile.jpg', 'somefile.rgb')

if __name__ == '__main__':

loader is an instance of the Loader class, defined in From the ShowBase constructor:

self.loader = Loader.Loader(self)
builtins.loader = self.loader