pippyyaml

How to upgrade disutils package PyYAML?


I was trying to install chatterbot which has a dependency on PyYAML=3.12. In my Ubuntu machine installed PyYAML version is 3.11. So I used the following command to upgrade PyYAML:

sudo -H pip3 install --upgrade PyYAML

But it gives the following error:

Cannot uninstall 'PyYAML'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

My pip3 version is 10.0.0.

How to resolve this?


Solution

  • I found in this Github issue that pip 10 no longer uninstalls distutils packages. So I downgraded to pip 8.1.1. And now it works.

    And to downgrade pip, I used the following:

    sudo -H pip3 install pip==8.1.1