python2.7和NLTK安装详细教程
作者:s5plus1 发布时间:2021-03-30 22:41:19
标签:python,python2.7,NLTK
本文为大家分享了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,无错误表示成功。
来源:https://blog.csdn.net/joey_su/article/details/17287559
0
投稿
猜你喜欢
- 微信小程序一出,立马炸开了锅,都去搭建自己的开发环境,我这里也来尝尝先,之前发了一篇文章,有人问Demo怎么导入?Demo源代码(来自网络)
- 一、概述OLAP的系统(即Online Aanalyse Process)一般用于系统决策使用。通常和数据仓库、数据分析、数据挖掘等概念联系
- 工具版本python版本:3.8 django版本:2.0.0 mysql版本: 5.5.53 pip3创建工程djangostartDja
- 这种方案是通过对代码进行加密,然后利用C语音写解密的PHP扩展。破解难度会有提升,但依然是会被破解的。 从网上找过各种代码加密的开源方案。
- 在开发的过程中,经常会遇到需要给别人提供一个输入框,然后别人输入一些ID,或者关键字的东西,例如wordpress的后台的标签输入框:这个就
- Python中编码问题:u'\xe6\x97\xa0\xe5\x90\x8d' 类型的转为utf-8的解决办法相信小伙伴们遇
- 目录准备xlrd 读取 Excelxlwt 写入 Excel进阶用法最后准备使用 Python 操作 Excel 文件,常见的方式如下:xl
- 本文主要介绍python 数据可视化模块 Matplotlib,并试图对其进行一个详尽的介绍。通过阅读本文,你可以:了解什么是 Matplo
- loc和iloc的意思首先,loc是location的意思,和iloc中i的意思是指integer,所以它只接受整数作为参数,详情见下面。l
- 本文为大家分享了centos7利用yum安装mysql 8.0.12的详细步骤,供大家参考,具体内容如下清理原有的mysqlrpm -qa
- 代码如下:SELECT [StartDate] FROM [dbo].[udf_Week](2012,2012) WHERE [
- 昨天在书友会上讨论信息分类和方法,有位朋友问:“大家现在讨论的还是几年前那套web2.0的东西,有没有一些新的东西可以分享?”我当时确实感觉
- 用ASP实现搜索引擎的功能是一件很方便的事,可是,如何实现类似3721的智能搜索呢?比如,当在搜索条件框内输入“中国人民”时,自动从中提取“
- 这是一个用python写解压大量zip脚本的说明,本人新手一个,希望能对各位有所启发。首先要注意的,在运行自己的脚本之前一定先备份或者复制出
- 在MySQL经历了2008年Sun的收购和2009年Oracle收购Sun的过程中,基本处于停滞发展的情况,在可以预见的未来,MySQL是肯
- MySQL密码正确却无法本地登录-1045 Access denied for user 'root'@'local
- 微信小程序可以通过wx.setStorage(wx.setStorageSync)、wx.getStorage(wx.getStorageS
- [code]<script> var a=4.2343; alert(a.toFixed(3)); </script>
- 以去掉去掉<!--和-->为例进行说明:def clearContentWithSpecialCharacter(content
- JSP之表单提交get和post的详解及实例一 get和post的区别二 实战(post方式提交)1、login.jsp<%@ pag