Forum Archive

How to install modules

upwart

I have a couple of my own modules that I would like to store in a separate folder. However,Pythonista can't find them there. How can I put a module somewhere else tahn in the programs directory and still find it?

ccc

Some versions to DropboxSync contain this code:

# I moved 'dropboxlogin' into a sub folder so it doesn't clutter my main folder
sys.path += [os.path.join(os.path.dirname(os.path.abspath(__file__)), 'lib')]
import dropboxlogin # this code can be found here https://gist.github.com/4034526

It seems to take the directory of this file and add /lib to it and the add it to sys.path. That might work for you.