Problem installing NLTK for a channel on Ubuntu using Virtualenv

For reference, here is the documentation for installing nltk nltk here

Is there a way to install nltk using pip and virtualenv? I installed the dependencies using pip in my virtualenv, but when I try to install nltk, it fails.

The error is that there is no installation script. To install linux, the nltk website has installation instructions for installing sudo python setup.py install. But how could I do this in virtualenv?

The pip downloads and starts installing nltk, so of course they plan for people to use pip if it was in the package index.

+4
source share
1 answer

It looks like pip is grabbing the first .tar.gz package from PyPI. For nltk, this is the macosx binary. You will need to explicitly point to the correct package.

The easiest way to do this is to simply provide the full path to the package.

pip install http://pypi.python.org/packages/source/n/nltk/nltk-2.0.1rc1.tar.gz 

Another solution is to download the package to a known directory and install it there. For example, let's say you upload a package to ~/Downloads . The command will be as follows:

 pip install ~/Downloads/nltk-2.0.1rc1.tar.gz 
+4
source

Source: https://habr.com/ru/post/1381988/


All Articles