Unachievable pyyaml>=5.4.1 requirement on Ubuntu 20.04?

Did I install docker wrong in my Ubuntu 20.04 install? I seem to be getting an error that pyyaml needs to be >= 5.4.1, but according to this, the latest released pyyaml is 5.3.1?

tutor local quickstart
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 584, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 901, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 792, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (PyYAML 5.3.1 (/usr/lib/python3/dist-packages), Requirement.parse('pyyaml>=5.4.1'), {'kubernetes'})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/parallels/.local/bin/tutor", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3254, in <module>
    def _initialize_master_working_set():
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3237, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3266, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 586, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 599, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 792, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (PyYAML 5.3.1 (/usr/lib/python3/dist-packages), Requirement.parse('pyyaml>=5.4.1'), {'kubernetes'})

I just installed things with

sudo apt install python3 python3-pip libyaml-dev docker docker-compose -y
1 Like

Upgrade pyyaml through pip

pip install --upgrade pyyaml
1 Like

Upgrade pyyaml to version 5.4.1 using command below. This solved issue for me

pip install PyYAML==5.4.1

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.