python2.7和NLTK安装详细教程
程序员文章站
2022-07-10 22:20:08
本文为大家分享了python2.7和nltk安装教程,具体内容如下
系统:windows 7 ultimate 64-bits
python 2.7安装
下载pyth...
本文为大家分享了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。
解决办法:
(1)新建一个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\\" % (version) installkey = "installpath" pythonkey = "pythonpath" pythonpath = "%s;%s\\lib\\;%s\\dlls\\" % ( installpath, installpath, installpath ) def registerpy(): try: reg = openkey(hkey_current_user, regpath) except environmenterror as e: try: reg = createkey(hkey_current_user, regpath) setvalue(reg, installkey, reg_sz, installpath) setvalue(reg, pythonkey, reg_sz, pythonpath) closekey(reg) except: print "*** unable to register!" return print "--- python", version, "is now registered!" return if (queryvalue(reg, installkey) == installpath and queryvalue(reg, pythonkey) == pythonpath): closekey(reg) print "=== python", version, "is already registered!" return closekey(reg) print "*** unable to register!" print "*** you probably have another python installation!" if __name__ == "__main__": registerpy()
(2)开始-运行-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(python gui),输入import nltk,无错误表示成功。
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。
推荐阅读
-
eclipse和myeclipse安装教程及eclipse汉化教程(图文)
-
Photolemur 3中文版安装破解详细图文教程
-
Edraw Project怎么安装?Edraw Project安装与制定项目计划详细图文教程
-
Alien Skin Exposure X4+Bundle注册破解详细安装教程(附破解下载)
-
森林插件Itoo Forest Pack Pro for 3ds Max2019破解版详细安装教程(附下载)
-
PTC Mathcad Prime 5.0破解版安装+许可激活图文详细教程(附下载)
-
MySQL5.7.20解压版安装和修改root密码的教程
-
微信怎么备份数据?微信聊天记录备份迁移和恢复详细图文教程
-
Python快速入门之迭代器和生成器!最详细的教程!祝早日入门!
-
手把手教你如何安装Pycharm(详细图文教程)