Lab: Python - pip error

Hello,
there seems to be a problem with the python deploy flask lab and the python PIP lab (only after the second question in the lab):
When I try to execute pip -V or pip2 -V I get this:
thor@host01 /opt$ pip -V
Traceback (most recent call last):
File “/usr/bin/pip”, line 9, in
load_entry_point(‘pip==21.0’, ‘console_scripts’, ‘pip’)()
File “/usr/lib/python2.7/site-packages/pkg_resources.py”, line 378, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File “/usr/lib/python2.7/site-packages/pkg_resources.py”, line 2566, in load_entry_point
return ep.load()
File “/usr/lib/python2.7/site-packages/pkg_resources.py”, line 2260, in load
entry = import(self.module_name, globals(),globals(), [‘name’])
File “/usr/lib/python2.7/site-packages/pip/_internal/cli/main.py”, line 60
sys.stderr.write(f"ERROR: {exc}") ^
SyntaxError: invalid syntax

sudo pip3 install flask will work fine , we will fix this, thanks for the notice.

I can’t run with pip and therefore I can’t continue.


I did it with pip3 and no problem but the task carry on bad

???

When will this issue be resolved? Applications expect python2 as default installation. Pip 3 install works but it is not expected by the lab environment.

The same issue happens in other python labs too as @juancgarciaco mentioned

When will this issue be resolved?

Traceback (most recent call last):
File “/bin/pip”, line 9, in
load_entry_point(‘pip==21.0.1’, ‘console_scripts’, ‘pip’)()
File “/usr/lib/python2.7/site-packages/pkg_resources.py”, line 378, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File “/usr/lib/python2.7/site-packages/pkg_resources.py”, line 2566, in load_entry_point
return ep.load()
File “/usr/lib/python2.7/site-packages/pkg_resources.py”, line 2260, in load
entry = import(self.module_name, globals(),globals(), [‘name’])
File “/usr/lib/python2.7/site-packages/pip/_internal/cli/main.py”, line 60
sys.stderr.write(f"ERROR: {exc}")
^
SyntaxError: invalid syntax

Pip no longer supports Python 2.7

1 Like