I'm using Ubuntu 16.04 , when I enter pip --version in the terminal I get this error.
Traceback (most recent call last):
File "/home/diyazen/.local/bin/pip", line 4, in <module>
import re
File "/usr/lib/python3.5/re.py", line 335, in <module>
import copyreg
File "/usr/lib/python2.7/dist-packages/copyreg/__init__.py", line 7, in <module>
raise ImportError('This package should not be accessible on Python 3. '
ImportError: This package should not be accessible on Python 3. Either you are trying to run from the python-future src folder or your installation of python-future is corrupted.
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 53, in apport_excepthook
if not enabled():
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 24, in enabled
import re
File "/usr/lib/python3.5/re.py", line 335, in <module>
import copyreg
File "/usr/lib/python2.7/dist-packages/copyreg/__init__.py", line 7, in <module>
raise ImportError('This package should not be accessible on Python 3. '
ImportError: This package should not be accessible on Python 3. Either you are trying to run from the python-future src folder or your installation of python-future is corrupted.
Original exception was:
Traceback (most recent call last):
File "/home/diyazen/.local/bin/pip", line 4, in <module>
import re
File "/usr/lib/python3.5/re.py", line 335, in <module>
import copyreg
File "/usr/lib/python2.7/dist-packages/copyreg/__init__.py", line 7, in <module>
raise ImportError('This package should not be accessible on Python 3. '
ImportError: This package should not be accessible on Python 3. Either you are trying to run from the python-future src folder or your installation of python-future is corrupted.
I searched for this error and one solution was provided on one of the threads here to
unset PYTHONPATH "This package should not be accessible on Python 3" when running python3
After unsetting python path and again running the pip --version I get this error.
Traceback (most recent call last):
File "/home/diyazen/.local/bin/pip", line 7, in <module>
from pip._internal.cli.main import main
File "/home/diyazen/.local/lib/python3.5/site-packages/pip/_internal/cli/main.py", line 57
sys.stderr.write(f"ERROR: {exc}")
^
SyntaxError: invalid syntax
Has anyone else also had similar error/ if so how to resolve these kind of error/. Thank you .