Python NLTK Environment Setup

Source: Internet
Author: User
Tags nltk

1. Install Python (I am installing Python2.7.8, folder D:\Python27)

2. Install NumPy (optional)

Download here: Http://sourceforge.net/projects/numpy/files/NumPy/1.6.2/numpy-1.6.2-win32-superpack-python2.7.exe

Note the PY version number

Run exe file after download (the program will actively search the Python27 folder)

3. Install NLTK (i downloaded nltk-2.0.3)

Download here: HTTP://PYPI.PYTHON.ORG/PYPI/NLTK

Unzip the nltk-3.0.0 to the D:\Python27 folder

Open cmd, go to D:\Python27\nltk-3.0.0 folder (input: cd D:\Python27\nltk-3.0.0)

Input command: Python setup.py install

At this point, Import error:no module named SetuptoolsWindows does not have the Setuptool module installed by default, download the module yourself. exe (http://www.cr173.com/ soft/40214.html#address)

4. Install Pyyaml:

Download here: Http://pyyaml.org/wiki/PyYAML

Note the PY version number

Run exe file after download (the program will actively search the Python27 folder)

5. Open idle, enter import NLTK, no error. The instructions are installed successfully.

to here. The basic Python modules required for NLP are already installed, and then you have to install Nltk_data.

There are several ways to download nltk_data. Here I just introduce a

6. Proceed to fifth step, already import nltk, then enter Nltk.download () so that you can open a NLTK Downloader (NLTK Downloader)

7. Note the download Directory below the downloader. I'm setting up a C:\nltk_data.

8. On computer-Properties-Advanced system Settings-advanced-environment variables-System variables-NEW: Top: Nltk_data, bottom: C:\nltk_data

9. Select the package (corpus, module) you want to download. Be able to download once (I always appear out of date during the download). can also be downloaded individually (this is faster, the overall download speed is very slow)

10. How do I test after installing a successful package? Enter the statement below to be able to.

 from Nltk.corpus Import Brown  Brown. words ()[' The ', ' Fulton ', ' County ', ' Grand ', ' jury ', ' said ', ...]

Installation of another Python classic drawing library matplotlib: http://blog.csdn.net/huruzun/article/details/39395343

These environments are set up, the basic Python needs of the most commonly used toolkit and so on is finished!

Python NLTK Environment Setup

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.