I have recently updated my ubuntu version from Ubuntu 18.04 LTS to Ubuntu 20.04 LTS. This process has deleted my older versions of python and now I'm having python3.8 and python2.7 in my machine. However, on using pip for doing anything (even pip --version) gives me the following error:
bash: /home/<user>/.local/bin/pip: /usr/bin/python3.7: bad interpreter: No such file or directory
The same is the issue with pip3. I know that there is no python3.7 in my system now. But I am unable to figure out how to resolve the issue. Here's what I have tried so far:
Uninstalling and reinstalling pip.
sudo apt-get remove python3-pip sudo apt-get install python3-pip
-
python3 -m pip --version
The above command gives the following error. There are a few of my personal directories also getting used while running this command (which I don't think should happen ideally). Since I not sure about what is the source of the error, I am mentioning the entire message:
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 184, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/lib/python3.8/runpy.py", line 143, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/usr/lib/python3.8/runpy.py", line 110, in _get_module_details
__import__(pkg_name)
File "/home/<user>/Documents/Web dev/SocialSiteClone/socialsite/lib/python3.6/site-packages/pip/__init__.py", line 31, in <module>
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File "/home/<user>/Documents/Web dev/SocialSiteClone/socialsite/lib/python3.6/site-packages/pip/vcs/mercurial.py", line 9, in <module>
from pip.download import path_to_url
File "/home/<user>/Documents/Web dev/SocialSiteClone/socialsite/lib/python3.6/site-packages/pip/download.py", line 37, in <module>
from pip.utils.ui import DownloadProgressBar, DownloadProgressSpinner
File "/home/<user>/Documents/Web dev/SocialSiteClone/socialsite/lib/python3.6/site-packages/pip/utils/ui.py", line 16, in <module>
from pip._vendor.progress.helpers import (WritelnMixin,
ModuleNotFoundError: No module named 'pip._vendor.progress.helpers'
Please note that I no longer have python3.6 installed in my system as mentioned before.
However, any of these haven't solved my issue. Could somebody please help in figuring out what to do!
Here is the output of some of the commands which elaborate the specifications of my computer:
Command:
ls -la /usr/bin/python3.8
Output:
-rwxr-xr-x 1 root root 5453504 Jul 16 19:30 /usr/bin/python3.8
Command:
echo $PYTHONPATH
Output: (here socialsite is a venv)
/home/<user>/Documents/Web dev/SocialSiteClone/socialsite/lib/python3.6/site-packages