python2.7和NLTK安装详细教程
作者: / 2019-08-02 / 浏览次数:

本文为大家分享了python2.7和nltk安装教程,具体内容如下

系统:windows 7 ultimate 64-bits

python 2.7安装

下载python 2.7:

安装

nltk安装

1、下载nltk,, 安装。

2、安装时会出现以下错误:python version 2.7 required, which was not found in the registry。

解决办法:

新建一个register.py文件,把以下代码粘贴进去,保存到d盘。

# script to register python 2.0 or later for use with win32all 
# and other extensions that require python registry settings 
# written by joakim loew for secret labs ab / pythonware 
# source: 
# http://www.pythonware.com/products/works/articles/regpy20.htm 
# modified by valentine gogichashvili as described in http://www.mail-archive.com/distutils-sig@python.org/msg10512.html 
import sys 
from _winreg import * 
# tweak as necessary 
version = sys.version[:3] 
installpath = sys.prefix 
regpath = "software\python\pythoncore\%s\" %  
installkey = "installpath" 
pythonkey = "pythonpath" 
pythonpath = "%s;%s\lib\;%s\dlls\" % : 
 try: 
 reg = openkey 
 except environmenterror as e: 
 try: 
 reg = createkey 
 setvalue 
 setvalue 
 closekey 
 except: 
 print "*** unable to register!" 
 return 
 print "--- python", version, "is now registered!" 
 return 
 if  == installpath and 
 queryvalue == pythonpath): 
 closekey 
 print "=== python", version, "is already registered!" 
 return 
 closekey 
 print "*** unable to register!" 
 print "*** you probably have another python installation!" 
if __name__ == "__main__": 
 registerpy

开始-运行-cmd,把d:\register.py复制进去按回车,出现python 2.7 is already registered!则表示配置成功。

3、继续安装setuptools
4、安装pip:开始-运行-d:\program files\python\scripts\easy_install pip
5、安装pyyaml和nltk:开始-运行-d:\program files\python\scripts\pip install pyyaml nltk
6、测试安装:开始-所有程序-python 2.7-idle,输入import nltk,无错误表示成功。




以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持萬仟网。

【某某业务】网站建设、网站设计、服务器空间租售、网站维护、网站托管、网站优化、百度推广、自媒体营销、微信公众号
如有意向---联系我们
热门栏目
热门资讯

网站建设 网站托管 成功案例 新闻动态 关于我们 联系我们 服务器空间 加盟合作 网站优化

备案号: 

公司地址:江苏省南京市玄武区玄武湖 咨询QQ:9490489 手机: 电话: