When I run
#pip3
command I received below error.
Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in <module>
from pip import main
File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 16, in <module>
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File "/usr/lib/python2.7/dist-packages/pip/vcs/subversion.py", line 9, in <module>
from pip.index import Link
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 30, in <module>
from pip.wheel import Wheel, wheel_ext
File "/usr/lib/python2.7/dist-packages/pip/wheel.py", line 6, in <module>
import compileall
File "/usr/lib/python3.5/compileall.py", line 20, in <module>
from concurrent.futures import ProcessPoolExecutor
File "/usr/lib/python2.7/dist-packages/concurrent/futures/__init__.py", line 8, in <module>
from concurrent.futures._base import (FIRST_COMPLETED,
File "/usr/lib/python2.7/dist-packages/concurrent/futures/_base.py", line 357
raise type(self._exception), self._exception, self._traceback
^
SyntaxError: invalid syntax
what I tried to resolve ?
Step 1 - Uninstall
sudo apt-get remove python3-pip
Step 2 - Delete the directory
/usr/local/lib/python3.5/dist-packages
Step 3 - Reinstall pip3
sudo apt-get install python3-pip
When i run pip3 command i still get the same error mentioned above.
Much appreciated the help?.
Note Ubuntu Version:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.5 LTS"
python -V; python3 -V
. Most issues I've seen relate to users changing their default python versions... I'd also check your system is fully-upgraded; as 16.04.5 implies you've not fully-upgraded since before 2019-Mar-01 (fridge.ubuntu.com/2019/03/01/ubuntu-16-04-6-lts-released) as your system should have reported 16.04.6 which could also be your problem too.~/.bashrc
comment out the line with the PYTHONPATH and then run. ~/.bashrc
to source the file and then runexport PYTHONPATH=''
for good measure. Let me know if you have it set and I will make this an answer.echo $PYTHONPATH
and it should return nothing. If you get response, follow my previous comment to unset it.