Installation of NLTK (Installation of NLTK), Notes, page 724662
https://www.purl.org/stefan_ram/pub/installation_nltk_python (permalink) is the canonical URI of this page.
Stefan Ram
Python Course

Installation of NLTK 

Installation of Python 3.7 

It is possible that the installation procedure we have chosen may not work with every version of Python. We will assume Python 3.7  here. So, if you have not yet installed Python 3.7  yet, please go ahead and install Python 3.7  now. It is possible that the NLTK  wheel may not work with Python 3.6  or Python 3.8 .

Installation from Christoph Gohlke 's web site

To use the website of Christoph Gohlke, JavaScript  needs to be activated in the web browser.

URI of Christoph Gohlke 's wheel page
https://www.lfd.uci.edu/~gohlke/pythonlibs/

The required NLTK  wheel »nltk-3.5-py3-none-any.whl« should be downloaded from Christoph Gohlke 's web site to the directory »wheel«.

main.py

import os
import pprint
import subprocess
import sys

def execute( args ):
command = subprocess.list2cmdline( args )
with subprocess.Popen \
( command,
stdout=__import__( 'subprocess' ).PIPE,
stderr=__import__( 'subprocess' ).STDOUT,
bufsize=1, universal_newlines=True ) as p:
for line in p.stdout: print( line, end='' )
print( 'returncode = ', p.returncode )
return p.returncode

def install( wheel ):
execute( [ r"py", r"-3.7", r"-m", r"pip", r"install", wheel ] )

def main():
os.chdir( r"wheel" )
install( r"nltk-3.5-py3-none-any.whl" )

Installation without  Internet connectivity *

When you want to install without an Internet connection, you can manually copy the five wheels required into the directory »wheel« with an Internet connection and then install without an Internet connection.

The function »main«
def main():
os.chdir( r"wheel" )
install( r"regex-2020.4.4-cp37-cp37m-win_amd64.whl" )
install( r"tqdm-4.45.0-py3-none-any.whl" )
install( r"joblib-0.14.1-py2.py3-none-any.whl" )
install( r"click-7.1.1-py3-none-any.whl" )
install( r"nltk-3.5-py3-none-any.whl" )

Some error messages, like »Could not fetch URL https://pypi.org/simple/pip/« can then be ignored.

Installation from the official distribution *

The installation of NLTK  from the distribution of its creators would require to use an appropriate C  compiler during the installation. It is quite possible to choose this option, but it might be easier to install precompiled wheels from Christoph Gohlke.

 

About this page, Impressum  |   Form for messages to the publisher regarding this page  |   "ram@zedat.fu-berlin.de" (without the quotation marks) is the email address of Stefan Ram.   |   A link to the start page of Stefan Ram appears at the top of this page behind the text "Stefan Ram".)  |   Copyright 1998-2020 Stefan Ram, Berlin. All rights reserved. This page is a publication by Stefan Ram. relevant keywords describing this page: Stefan Ram Berlin slrprd slrprd stefanramberlin spellched stefanram724662 stefan_ram:724662 Installation of NLTK Stefan Ram, Berlin, and, or, near, uni, online, slrprd, slrprdqxx, slrprddoc, slrprd724662, slrprddef724662, PbclevtugFgrsnaEnz Explanation, description, info, information, note,

Copyright 1998-2020 Stefan Ram, Berlin. All rights reserved. This page is a publication by Stefan Ram.
https://www.purl.org/stefan_ram/pub/installation_nltk_python