Linux 下安装NLTK的过程
1. 使用虚拟机安装Linux
2. 使用Miniananconda安装Python
下载地址:https://docs.conda.io/en/latest/miniconda.html#linux-installers
执行命令: bash /root/Miniconda3-latest-Linux-x86_64.sh
一路回车之后,Minianaconda会安装在
/root/miniconda3
重启Linux
3. 创建虚拟Python环境
conda create -n env_nlp python=3.8
4. 激活NLP环境
conda activate env_nlp
conda install nltk
进入Python客户端
python
# 由于是自己安装的Linux,没有安装SSL库,无法下载NLTK语料库,需要做下设置,才能下载
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
#下载语料库
import nltk
nltk.download('all')
好了,静静等待就好了
对了,如果太慢了,就改一下Anaconda的下载库地址,改为清华的库地址