4

After activating the virtual environment, when I try:

$ sudo pip install -U nltk

it shows this message:

Requirement already up-to-date: nltk in /usr/local/lib/python2.7/dist-packages

Why isn't it downloading those packages? Should I use --no-site-packages while activating?

winseybash
  • 704
  • 2
  • 12
  • 27
bazzi
  • 559
  • 1
  • 8
  • 23
  • `Requirement already up-to-date:`... It's **already installed** – OneCricketeer Nov 26 '16 at 17:55
  • 1
    Though, I do not think you've activated the virtualenv because it's running pip from `/usr/local/lib/python2.7` (and you should not need to use sudo for virtualenvs) – OneCricketeer Nov 26 '16 at 17:56
  • @cricket_007 I had activated the virtualenv but was using sudo as also poined by Denilson Sá Maia. – bazzi Nov 26 '16 at 18:05

1 Answers1

6

Wait, if you are inside the virtual environment, you shouldn't use sudo.

In fact, using sudo will spawn a new shell that may have different variables, and thus this sudo-shell will be outside the virtual environment. (Note: this paragraph is speculation; I have not tested it.)

Try again without sudo.

Denilson Sá Maia
  • 47,466
  • 33
  • 109
  • 111