Attached a screenshot of the error. I have tried creating python 3 and python2 virtualEnv but nothing is working. Any help would be highly appreciated.
I solved the problem by updating the ipython kernel. I could not run any notebook because it was showing 0
active kernel message in the command prompt and hence I couldn't run any python kernel in the browser. Following steps solved the problem:
sudo apt-get -y install ipython ipython-notebook
sudo -H pip install jupyter
Following this link solved the problem.