installing any python module

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Fri Jul 11 10:18:50 CEST 2008


En Thu, 10 Jul 2008 14:02:29 -0300, Bhagwat Kolde <bbkolde at gmail.com>  
escribi�:

> What is the correct process of installing any external python module?
> Once we downloaded any python module,
>
> Q1) Where this module should be placed in python installation file
> structure?

If it is a single Python module, you can put it anywhere in the Python  
path. A good place may be the site-packages subdirectory. Execute this  
line to see the list of directories that are currently searched for  
modules:

python -c "import sys; print '\n'.join(sys.path)"

More complex packages (containing many modules and its own internal  
hierarchy) usually provide a setup.py script

> Q2) How to execute setup.py file?

Like any other script. For many Python packages, you only have to execute  
this:

cd path/to/the/downloaded/and/uncompressed/package
python setup.py install

Please read the package documentation for any specific instructions. There  
is a generic guide aimed at site administrators: "Installing Python  
Modules" <http://docs.python.org/inst/>

-- 
Gabriel Genellina




More information about the Python-list mailing list