Not able to connect to local host - Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory

After running this command below-
pip install --upgrade jupyter_http_over_ws>=0.0.7 && \

jupyter serverextension enable --py jupyter_http_over_ws

Error-
Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: ‘/home/shresth/.local/lib/python2.7/site-packages/pip-19.0.dist-info/METADATA’

I tried to take help from stack overflow but could not resolve.
Edit- I am working on ubuntu.

Looks like some files are missing, have you tried uninstalling the present version, and then install the latest version?

Still not working , same error. Tried everything from my end. Dont know how to proceed further.
Any other suggestion ?

You’re using Python 2.7, it’s deprecated… did you try out installing python3 ?

yes i updated to python 3

But it shows a path from Python2.7
Have you tried this out?

Another option would be to try the following:

Ok I am trying out these steps.

Still couldn’t resolve the issue. My python version is 3.7 but the error remains same.

After trying everything i could, this is the error i am getting-
Any suggestions?

@Ishvinder
@sanjayk
Please respond to this thread. Any suggestion is highly appreciated.
Thank you in advance.

Hi,
This thread might help, it has some solutions to your problem.