3

So I created a virtual environment but forgot to activate it. I then ran pip install flask thinking I was in the new virtualenv. This returned a denied permissions error, so I ran it again with sudo in front. Shortly after, I realized what I had done. I did a quick search here and found this question. However, when I run sudo pip uninstall flask (as suggested in that link) I get this back "Can't uninstall 'Flask'. No files were found to uninstall."

Did I actually install it system-wide? If so, why does it tell me this when I try to uninstall it, and how do I actually reverse this system-wide installation?

Thanks in advance

Community
  • 1
  • 1
  • Have you checked that the initial installation actually was successful ? Can you open python interpreter and type "import flask" – codegeek Jun 03 '13 at 21:17
  • If `flask` isn't exactly the right name for the package, `pip install` does a lot more guessing than `pip uninstall` does. – abarnert Jun 03 '13 at 21:41

1 Answers1

3

It pretty weird that you can't uninstall using pip... However, you can always resort to a manual removal if necessary:

  • Go to your python install sites-packages directory. If you don't know where that is, an easy way is to run the following:

    >>> import flask
    >>> flask.__file__
    
  • Remove the flask directory in there, and the Flask-0.9-py2.7.egg-info that may exist

icecrime
  • 74,451
  • 13
  • 99
  • 111
  • within my python2.7 directory I have site-packages/ and dist-packages/ but site-packages/ is empty. dist-packages/ on the other hand has both directories you referred to. Is it safe to remove them from here? – KimJongTrill Jun 03 '13 at 21:22
  • I'm not familiar with this directory layout. Was does `flask.__file__` tells you? Is it from here that is was imported? – icecrime Jun 03 '13 at 21:24
  • Oh, apparently, [`dist-packages` is just a Debian specificity](http://stackoverflow.com/questions/9387928/whats-the-difference-between-dist-packages-and-site-packages), so you're safe to remove flask from it. – icecrime Jun 03 '13 at 21:25
  • I just found this: http://stackoverflow.com/questions/9387928/whats-the-difference-between-dist-packages-and-site-packages which makes it look like they are the same kind of directory but Ubuntu (which I am running) installs to dist- instead of sites- – KimJongTrill Jun 03 '13 at 21:28