How to upgrade disutils package PyYAML?

后端 未结 7 870
囚心锁ツ
囚心锁ツ 2020-12-23 18:53

I was trying to install chatterbot which has a dependency on PyYAML=3.12. In my Ubuntu machine installed PyYAML version is

7条回答
  •  隐瞒了意图╮
    2020-12-23 19:15

    Try using the --ignore-installed flag:

    sudo -H pip3 install --ignore-installed PyYAML

    This works because to upgrade a package, pip first uninstalls the old version, then installs the new version. It is the uninstall step that fails for distutils packages. With the --ignore-installed flag, the uninstall step is skipped and the new version is simply installed on top of the old one.

提交回复
热议问题