Python NLTK Environment Setup

Source: Internet
Author: User
Tags nltk

This is the first I have done the installation NLTK, the installation was successful. At that time, remember to refer to this post: Http://www.tuicool.com/articles/VFf6Bza

Wherein, NLTK installation, encountered the module was not found, followed by the prompt corresponding to download four or five modules, only successfully installed. Later, the corpus is also installed offline.

1. Install Python (I am installing Python2.7.8, directory 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

EXE file after download (the program will automatically search the Python27 directory)

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 directory

Open cmd, go to D:\Python27\nltk-3.0.0 directory (input: CD D:\Python27\nltk-3.0.0)

Input command: Python setup.py install

In this case, Import error:no module named Setuptools Windows does not install the Setuptool module 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

EXE file after download (the program will automatically search the Python27 directory)

5. Open idle, enter import NLTK, no error, it means the installation was successful.

Here, the basic Python modules required for NLP are already installed, and then the Nltk_data is installed.

There are several ways to download nltk_data, here I only introduce a

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

7. Note the download Directory below the downloader, I set the 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, you can download it all at once (I always appear out of date during the download), or you can download it individually (this is faster and the overall download speed is slow)

10. How to test the package after successful installation? Enter the statement below to do so.

BrownBrown.  Words()[' said ', ...]     

There is also a Python classic drawing library matplotlib installation: http://blog.csdn.net/huruzun/article/details/39395343

These environments are well-built, the basic Python needs of the toolkit and so on is finished!

Python NLTK Environment Setup

Related Article

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.