How can I test that I have a Python module successfully installed?
Question: I tried to install beautifulsoup. I get such an error:  
<\-- snip -->

    
    
    raise MissingSectionHeaderError(fpname, lineno, line)
    ConfigParser.MissingSectionHeaderError: File contains no section headers.
    file: /Users/Sam/.pydistutils.cfg, line: 1
    'install_lib = ~/Library/Python/$py_version_short/site-packages\n'
    

I get an similar error as I run my Python code in vim by: :!python %


Answer: You can test if a module is installed like so:

    
    
    $ python
    >>> import modulename
    

