ipython fails to start
Question: I had previously installed ipython against python2.7. After I installed
`python3-pip` using

    
    
    $sudo apt-get install python3-pip
    

and ran the following command

    
    
    $sudo pip3 install ipython
    

, I'm unable to start `ipython`. I get the following errors:

    
    
    kv@kv:~$ ipython
    
    
    Traceback (most recent call last):
      File "/usr/local/bin/ipython", line 7, in <module>
        from IPython import start_ipython
      File "/usr/lib/python2.7/dist-packages/IPython/__init__.py", line 43, in <module>
        from .config.loader import Config
      File "/usr/lib/python2.7/dist-packages/IPython/config/loader.py", line 165
        except KeyError, e:
                       ^
    SyntaxError: invalid syntax
    Error in sys.excepthook:
    Traceback (most recent call last):
      File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
        from apport.fileutils import likely_packaged, get_recent_crashes
      File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
        from apport.report import Report
      File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
        import apport.fileutils
      File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
        from apport.packaging_impl import impl as packaging
      File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 20, in <module>
        import apt
      File "/usr/lib/python2.7/dist-packages/apt/__init__.py", line 23, in <module>
        import apt_pkg
    ImportError: /usr/lib/python2.7/dist-packages/apt_pkg.so: undefined symbol: _Py_ZeroStruct
    
    Original exception was:
    Traceback (most recent call last):
      File "/usr/local/bin/ipython", line 7, in <module>
        from IPython import start_ipython
      File "/usr/lib/python2.7/dist-packages/IPython/__init__.py", line 43, in <module>
        from .config.loader import Config
      File "/usr/lib/python2.7/dist-packages/IPython/config/loader.py", line 165
        except KeyError, e:
                       ^
    SyntaxError: invalid syntax
    

How can I make `ipython` work under both `python2.7` and `python3.4`

Updated :

    
    
    kv@kv:~$ ipython2
    No command 'ipython2' found, did you mean:
     Command 'python2' from package 'python-minimal' (main)
     Command 'ipython' from package 'ipython' (universe)
     Command 'ipython3' from package 'ipython3' (universe)
    ipython2: command not found
    

and for `kv@kv:~$ ipython3` I get the error mentioned earlier


Answer: For me below commands works to shift b/w python versions.

To start ipyton for python 2

    
    
    $ ipython2
    

To start ipython for python 3

    
    
    $ ipython3
    

