How do you guys go about storing your python modules locally? And how do you then go about referencing them in your python scripts?
Should I do this?
/home/python/modules
And then create a sub-directory for each module, like say the amazon s3 module:
/home/python/modules/amazon-s3/s3.py
Now I have to somehow tell python to look at these folders for modules, which I think is sys.path somehow?
I usually store my modules in
/usr/local/lib/pythonfor the whole system, and/home/user/lib/pythonfor the user. That’s if they weren’t installed via the system package manager. If they were a .deb or .rpm or whatever, they’ll probably be placed in/usr/lib/python, as per the FHS standard, which specifies where different types of files should go on a POSIXish operating system.Set the
PYTHONPATHenvironment variable to have local packages be found by the interpreter.