Testing Python Modules

Once you have installed the package that provides the python module, you can test the installation by starting a Python interpreter and trying to import the module by hand.

If the module is properly installed then you will be able to import it without any errors:

$ python
Python 2.5.1 (r251:54863, Jun 15 2008, 18:24:56) 
[GCC 4.3.0 20080428 (Red Hat 4.3.0-8)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import dateutil
>>>
        

If the module is not properly installed, then you will see an error when trying to import it:

$ python
Python 2.5.1 (r251:54863, Jun 15 2008, 18:24:56) 
[GCC 4.3.0 20080428 (Red Hat 4.3.0-8)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import dateutil
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named dateutil
>>>