aws-samples/aws-modern-application-workshop

Module 5 pip install requests fails

Opened this issue · 1 comments

When trying to install the requests package during Module 5 the use of pip install fails:

~/environment/MythicalMysfitsStreamingService-Repository (master) $ pip install requests -t .
Traceback (most recent call last):
File "/usr/lib/python3.6/dist-packages/pkg_resources/init.py", line 658, in _build_master
ws.require(requires)
File "/usr/lib/python3.6/dist-packages/pkg_resources/init.py", line 972, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python3.6/dist-packages/pkg_resources/init.py", line 863, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (pip 9.0.3 (/usr/lib/python3.6/dist-packages), Requirement.parse('pip==7.1.0'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/bin/pip", line 5, in
from pkg_resources import load_entry_point
File "/usr/lib/python3.6/dist-packages/pkg_resources/init.py", line 3049, in
@_call_aside
File "/usr/lib/python3.6/dist-packages/pkg_resources/init.py", line 3033, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python3.6/dist-packages/pkg_resources/init.py", line 3062, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python3.6/dist-packages/pkg_resources/init.py", line 660, in _build_master
return cls._build_from_requirements(requires)
File "/usr/lib/python3.6/dist-packages/pkg_resources/init.py", line 673, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/lib/python3.6/dist-packages/pkg_resources/init.py", line 858, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==7.1.0' distribution was not found and is required by the application

adj97 commented

I had the same problem.
From following the guide, it looks like the push at Module 4 Step 3A includes dockerfile changes to use python/pip.
The Docker file from Module 3 onwards uses python/pip, but there are no pushes (as part of the guide) so I wouldn't have noticed this.

Solution:

I just reverted the Dockerfile back to using python3/pip3 and it's fixed the build.

Fix:

The dockerfile from module 3 onwards should use python3/pip3