pip is not uninstalling packages

前端 未结 5 1101
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-13 13:47

Background

I\'m working on an academic project to (basically) analyze some \"who follows whom\" graphs and wanted to get some real data (by building

相关标签:
5条回答
  • 2020-12-13 14:14

    While Martin's solution works, as a work around, it does not provide a direct answer. Ubuntu's pip version for your Ubuntu version (12.04) is:

     python-pip (1.0-1build1)
    

    This is also the same version for Debian Wheezy. This version has a weired bug, which causes packages not to be removed.
    If you obtain pip from upstream using the script get-pip.py you will have a fixed version of pip which can remove pacakges (as of now v. 1.5.6).

    update

    Python's pip is really a fast moving target. So using Debian's or Ubuntu's pip is guaranteed to have bugs. Please don't use those distribution's pip. Instead install pip from upstream.

    If you would like to register pip installed packages as system packages I really recommend that you also use stdeb.

    0 讨论(0)
  • 2020-12-13 14:18

    You can always manually delete the packages; you can run:

    sudo rm -rf /usr/local/lib/python2.7/dist-packages/twitter
    

    to remove that package from your dist-packages directory. You may have to edit the easy-install.pth file in the same directory and remove the twitter entry from it.

    0 讨论(0)
  • 2020-12-13 14:18

    In my case (moving pyusb 0.4x to 1.0x), removing the old package with apt-get remove python-usb and manually installing the manually downloaded package via python setup.py worked. Not pretty, but working.

    0 讨论(0)
  • 2020-12-13 14:24

    For me, it was due to the fact that I was running pip freeze, which gave me different results than sudo pip freeze.

    Since I was uninstalling using sudo, it was not uninstalling it in the "non-sudo" session. Uninstalling without sudo fixed that.

    0 讨论(0)
  • 2020-12-13 14:32

    I was facing difficulty while upgrading a package because pip was not able to uninstall it successfully. I had to delete the .egg-info and the folder as well in /usr/lib/python2.7/dist-packages and then I tried to install with --upgrade and it worked.

    0 讨论(0)
提交回复
热议问题