Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to install nltk in a virtual environment?

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?

like image 547
chamcham Avatar asked Sep 13 '25 16:09

chamcham


1 Answers

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.

like image 82
Denilson Sá Maia Avatar answered Sep 16 '25 07:09

Denilson Sá Maia