I installed some NLTK-packages in python3 NLTK (via nltk.download()
), tried them and -not needing them- want to remove them now.
How can I remove for example the package large_grammars
from my NLTK-installation? (I do not want to remove the complete NLTK-installation!)
Uninstall your current version of NLTK: Open up a terminal windows and type sudo pip uninstall nltk. Supply the administrative password, and then type "y" when prompted if you want to uninstall.
The argument to nltk. download() is not a file or module, but a resource id that maps to a corpus, machine-learning model or other resource (or collection of resources) to be installed in your NLTK_DATA area. You can see a list of the available resources, and their IDs, at http://www.nltk.org/nltk_data/ .
It depends on where you set the destination folder when you download the data using nltk. download(). On Windows 10, the default destination is either C:\Users\narae\nltk_data or C:\Users\narae\AppData\Roaming\nltk_data, but you can specify a different directory before downloading.
By default NLTK packages/data are saved in the nltk_data
directory.
First, you have to find where the directory might be:
>>> import nltk
>>> nltk.data.path
['/home/alvas/nltk_data', '/usr/share/nltk_data', '/usr/local/share/nltk_data', '/usr/lib/nltk_data', '/usr/local/lib/nltk_data']
Check the exact location of nltk_data
:
>>> import os
>>> next(p for p in nltk.data.path if os.path.exists(p))
'/home/alvas/nltk_data'
On linux, simply go to the directory on the command line:
$ cd /home/alvas/nltk_data/
$ ls
corpora grammars tokenizers
$ cd grammars/
$ ls
large_grammars large_grammars.zip
$ rm -rf large_grammars
$ rm large_grammars.zip
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With