您的位置:首页 > 编程语言 > Python开发

在Ubuntu下安装Python

2016-04-13 15:36 591 查看
在Ubuntu下安装Python模块通常可以使用apt-get和pip命令。apt-get命令是Ubuntu自带的包管理命令,而pip则是Python安装扩展模块的工具,通常pip会下载扩展模块的源代码并编译安装。Ubuntu 12.04中缺省安装了Python2.7.3,首先通过下面的命令安装pip,pip是Python的一个安装和管理扩展库的工具。
sudo apt-get install python-pip
安装Python开发环境,方便今后编译其他扩展库,占用空间92.8M:
sudo apt-get install python-dev
Install NLTK
Install NLTK: run [code]sudo pip install -U nltk
Install Numpy (optional): run
sudo pip install -U numpy
Test installation: run
python
then type
import nltk

Installing NLTK Data

>>> import nltk>>> nltk.download()[/code]

                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: