Uninstalling the easy_install(ed)

Today I was switching from the Python Cheese Shop’s version of the Twisted Web Framework to the trunk version.  I’d previously installed Twisted with the handy

easy_install PackageName

Worked great!  Unfortunately its not so obvious on how to uninstall…  After some research I found it and am sharing it here so I wont’ forget.

Simply use easy_install with the -m option

easy_install -m PackageName

Which will remove the installed dependencies.  Then you can delete the PackageName.egg file that easy_install left behind.  You may have to do some “locate”ing to find where it put the package as its different on every system.

Another hint is that easy_install creates a file easy-install.pth in your site-packages directory.  That file lists the path to the various eggs you’ve installed with easy_install.  In some cases you may simply be able to delete the path of your package in that file.

Advertisements
8 comments
  1. Thanks. Really, seriously thank you very very much.

    Regards,
    Ahmet

  2. Pingback: Upgrading Agilo

  3. erik said:

    this is great, i’m glad i found your site via google using “easy_install +uninstall”.

  4. Rather funny that the easy_install help calls this option “multi-version” which it explains as “make apps have to require() a version”. Thanks for the simple explanation!

  5. ali said:

    i want to remove easy_install (not package that installed via it). any idea?
    thanks

  6. Eugenio said:

    TYM for sharing knowledge. This worked for me.

  7. Felipe said:

    Hi,
    thanks for this helpful post. Right now I’m trying to uninstall the trash-cli (http://code.google.com/p/trash-cli) library but I’m having a problem. Can you give me an advice?

    thanks in advance,
    Felipe.

    easy_install -m trash-cli
    install_dir /usr/local/lib/python2.6/dist-packages/
    Searching for trash-cli
    Best match: trash-cli 0.11.3-r315
    Processing trash_cli-0.11.3_r315-py2.6.egg
    Installing trash-list script to /usr/local/bin
    Installing restore-trash script to /usr/local/bin
    Installing trash-put script to /usr/local/bin
    Installing volume-of script to /usr/local/bin
    Installing trash-empty script to /usr/local/bin

    Using /usr/local/lib/python2.6/dist-packages/trash_cli-0.11.3_r315-py2.6.egg

    Because this distribution was installed –multi-version, before you can
    import modules from this package in an application, you will need to
    ‘import pkg_resources’ and then use a ‘require()’ call similar to one of
    these examples, in order to select the desired version:

    pkg_resources.require(“trash-cli”) # latest installed version
    pkg_resources.require(“trash-cli==0.11.3-r315”) # this exact version
    pkg_resources.require(“trash-cli>=0.11.3-r315”) # this version or higher

    Processing dependencies for trash-cli
    Finished processing dependencies for trash-cli

    • whitney said:

      Felipe, I was getting the same output, which I took to mean I was actually just installing multiple versions of trash-cli instead of uninstalling the package which is what I wanted to do.

      Since all else failed, I just deleted the egg from /Library/Python/2.x/site-packages/ or used pip uninstall trash-cli (if you have pip installed, of course).

      I find pip’s uninstall command to be much easier to use as it does exactly what’s expected.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s