使用tar.gz下载在Ubuntu 13.10上安装nltk 3.0 [英] Install nltk 3.0 on Ubuntu 13.10 using tar.gz download

查看:125
本文介绍了使用tar.gz下载在Ubuntu 13.10上安装nltk 3.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Ubuntu 13.10上安装nltk 3.0.

I want to install nltk 3.0 on Ubuntu 13.10.

我已经运行Ubuntu几周了(我第一次使用Linux),而且我刚刚下载了python 3.4.0-3.3也安装在Ubuntu上,因为它是随操作系统一起安装的.还预先安装了Python 2.5+,实际上我已经使用终端安装了nltk(不是3.0),并且可以在我的python 2空闲状态下使用它,但不能像预期的那样在我的python 3空闲状态下使用.

I have been running Ubuntu for a few weeks (first time I am using Linux) and I have just downloaded python 3.4.0 - 3.3 is also on Ubuntu since it was installed with the operating system. Python 2.5+ is also preinstalled and I actually have the nltk (not 3.0) installed using the terminal and can use this in my python 2 idle, but not my python 3 idle as expected.

但是,我的新手将在这里闪耀.我不知道3.4安装在哪里,所以我不知道将nltk-3.0a3.tar.gz解压缩到哪里!

However, and my newbieness will shine here. I have no idea where 3.4 installed, so I don't know where to unzip the nltk-3.0a3.tar.gz !!

如果需要,我可以使用终端进行下载,我也不知道如何使用nltk 3.4.

I am fine with using the terminal to download if needed, I just don't know how with nltk 3.4 either.

推荐答案

请参见首先安装python3-pip,然后用它来安装pyyaml

First install python3-pip then use it to install pyyaml

$ sudo apt-get install python3-pip
$ sudo pip3 install pyyaml
$ wget http://www.nltk.org/nltk3-alpha/nltk-3.0a3.tar.gz
$ tar -xzvf nltk-3.0a3.tar.gz
$ cd nltk-3.0a3/
$ sudo python3 setup.py install
$ python3
>>> import nltk
>>> from nltk.corpus import brown
>>> print(brown.sents()[0])
['The', 'Fulton', 'County', 'Grand', 'Jury', 'said', 'Friday', 'an', 'investigation', 'of', "Atlanta's", 'recent', 'primary', 'election', 'produced', '``', 'no', 'evidence', "''", 'that', 'any', 'irregularities', 'took', 'place', '.']

这篇关于使用tar.gz下载在Ubuntu 13.10上安装nltk 3.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆