cannot instantiate a class even though it is in a module
Question: I want to use [`pycvss`](https://pypi.python.org/pypi/pycvss/1.0.2) so I
installed it via `pip`.

Instantiating the `Cvss()` class fails, though:

    
    
    >>> import pycvss
    >>> c = pycvss.Cvss()
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    AttributeError: 'module' object has no attribute 'Cvss'
    

When inspecting the module it indeed looks quite empty:

    
    
    >>> dir(pycvss)
    ['__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__']
    

But when I check where python looks for the module:

    
    
    >>> print(pycvss.__file__)
    /usr/local/python-2.7.8/lib/python2.7/site-packages/pycvss/__init__.pyc
    

it looks like that,

`/usr/local/python-2.7.8/lib/python2.7/site-packages/pycvss/pycvss.py`

does define `Cvss():

    
    
    (...)
    class Cvss(object):
      """Common Vulnerability Scoring System.
    
      Use this class to set base, temporal and environmental vectors and
      compute scores.
      Cf module level documentation for sample usage.
      """
    
      _BASE_VECTOR = (AV, AC, Au, C, I, A)
    (...)
    

I must be missing something obvious, but the more I look, the less I see
(other modules are fine, including those installed by `pip` like for instance
`requests`).


Answer: The [`__init__`
file](https://github.com/attwad/pycvss/blob/master/pycvss/__init__.py) in that
project is _empty_. You need to import the [nested `pycvss`
module](https://github.com/attwad/pycvss/blob/master/pycvss/pycvss.py):

    
    
    from pycvss import pycvss
    
    c = pycvss.Cvss()
    

The documentation is rather unclear about this; I'd file a [documentation
issue](https://github.com/attwad/pycvss/issues?q=is%3Aopen+is%3Aissue) with
the project.

Personally, I'd add one line to the `__init__.py` file here:

    
    
    from pycvss import Cvss
    

and update the documentation to illustrate how to import that class.

Note that the project expects the [`enum`
library](https://docs.python.org/3/library/enum.html) to be available. If you
are not using Python 3.4 or newer, you'll have to install the [`enum34`
backport package](https://pypi.python.org/pypi/enum34) too.

