Repository: Qiskit/qiskit

Issue:
qiskit.__qiskit_version__ does not return correct info
<!-- ⚠️ If you do not respect this template, your issue will be closed -->
<!-- ⚠️ Make sure to browse the opened and closed issues -->

### Information

- **Qiskit Terra version**: latest
- **Python version**:
- **Operating system**:

### What is the current behavior?
```python
qiskit.__qiskit_version__

{'qiskit': None,
 'qiskit-terra': '0.8.0',
 'qiskit-ignis': '0.1.1',
 'qiskit-aer': '0.2.1',
 'qiskit-ibmq-provider': '0.2.2',
 'qiskit-aqua': '0.5.0'}
```

but:

```
qiskit.__version__

'0.9.0'
```

Also, the versioning looks for the packages via pip, but this does not mean that terra can find them.  I have run into this before where I update terra (e.g. 0.8 -> 0.9) only to find that I must reinstall the ibmq-provider, aer, etc. even though the identical packages are in the site packages.

### Steps to reproduce the problem



### What is the expected behavior?



### Suggested solutions





Discussion:
I think the ideal solution here is for `__qiskit_version__` to grab terra version from ` qiskit.__version__` and then have versioning information included in all the other elements.  For example, ignis should have a `qiskit.ignis.__version__` that can be used to get its info.  This can then be checked with a `Try`, and if an element cannot be loaded we go to `None`.  Thus only those elements that can actually be found in qiskit are displayed in the versioning info.
> I think the ideal solution here is for `__qiskit_version__` to grab terra version from ` qiskit.__version__` and then have versioning information included in all the other elements. For example, ignis should have a `qiskit.ignis.__version__` that can be used to get its info. This can then be checked with a `Try`, and if an element cannot be loaded we go to `None`. Thus only those elements that can actually be found in qiskit are displayed in the versioning info.

I thought about doing it that way back when I added `__qiskit_version__`, but IIRC there were 3 reasons I didn't go that route. First was to actually figure out if the meta-package was installed and at which version. I had to use pip for that because there isn't actually any code installed. Also, when I checked ignis it didn't have a `__version__` string set (which we should fix, I meant to but forgot) and the other was because of -e and dev versions like what you were proposing in #1796. I think we can probably pair the two together and solve both this and the dev versions. But we'll still need to rely on pip to figure out if the meta package is in use.
Also I'm having a hard time reproducing the version mismatch you're hitting. I've reinstalled multiple versions of all the packages and dev versions with -e and I can't get it to report the wrong version locally. How exactly did you manage to do that?
I think we are on the same page.  I agree that meta cannot be tagged like the others.  I think the dev versioning is easily handled.  Something like:

```python

def git_short_hash():
    try:
        git_str = "+" + os.popen('git log -1 --format="%h"').read().strip()
    except:
        git_str = ""
    else:
        if git_str == '+': #fixes setuptools PEP issues with versioning
            git_str = ''
    return git_str

FULLVERSION = VERSION
if not ISRELEASED:
    FULLVERSION += '.dev'+str(MICRO)+git_short_hash()
```

does not work on win, but you still get a 'dev' coming out.

And as always, I role with `setup.py install`.  I am still bitter about`pip` messing up my `conda` installations. 

Resolving patch:
diff --git a/qiskit/version.py b/qiskit/version.py
--- a/qiskit/version.py
+++ b/qiskit/version.py
@@ -12,6 +12,8 @@
 # copyright notice, and modified files need to carry a notice indicating
 # that they have been altered from the originals.
 
+# pylint: disable=no-name-in-module,broad-except,cyclic-import
+
 """Contains the terra version."""
 
 import os
@@ -82,6 +84,29 @@ def get_version_info():
 
 
 def _get_qiskit_versions():
+    out_dict = {}
+    out_dict['qiskit-terra'] = __version__
+    try:
+        from qiskit.providers import aer
+        out_dict['qiskit-aer'] = aer.__version__
+    except Exception:
+        pass
+    try:
+        from qiskit import ignis
+        out_dict['qiskit-ignis'] = ignis.__version__
+    except Exception:
+        pass
+    try:
+        from qiskit.providers import ibmq
+        out_dict['qiskit-ibmq-provider'] = ibmq.__version__
+    except Exception:
+        pass
+    try:
+        from qiskit import aqua
+        out_dict['qiskit-aqua'] = aqua.__version__
+    except Exception:
+        pass
+
     cmd = [sys.executable, '-m', 'pip', 'freeze']
     reqs = _minimal_ext_cmd(cmd)
     reqs_dict = {}
@@ -96,11 +121,12 @@ def _get_qiskit_versions():
         elif len(req_parts) == 1:
             continue
         reqs_dict[req_parts[0]] = req_parts[1]
-    out_dict = {}
     # Dev/Egg _ to - conversion
     for package in ['qiskit_terra', 'qiskit_ignis', 'qiskit_aer',
                     'qiskit_ibmq_provider', 'qiskit_aqua']:
         if package in reqs_dict:
+            if package.replace('_', '-') in out_dict:
+                continue
             out_dict[package.replace('_', '-')] = reqs_dict[package]
 
     for package in ['qiskit', 'qiskit-terra', 'qiskit-ignis', 'qiskit-aer',


Test patch: