Friday 15 January 2010

How to make my Python module available system wide on Linux? -


I have created myself a small module that I have to use a lot whenever I need it , Then I'll copy it to the same folder in which I want to use it. Since I'm lazy, I want to install it so that I can call it from anywhere, even interactive prompts. So I read a bit about setting up here, and concluded that I need to copy the file to /usr/local/lib/python2.7/site-packages.

Does anyone know why I need to make a comprehensive copy of my module for this?

There are ways to install Python models system-wide I may want to take a look at you. A good tutorial for Distutils2 (current version) can be found.

You basically have to write a file setup.py that tells what to do distutils. You can then

  python setup.py install   

with root permissions to install your module system. There are good and easy examples, plus this is the best way I can imagine.

No comments:

Post a Comment