omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Step by step for installing NLTK?

    Pythonista
    4
    4
    6849
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • fiannao
      fiannao last edited by

      I'm fairly new to coding and Python, but have been using NLTK. I've been trying to download NLTK onto Pythonista, but have not had much success.

      Can someone give me a step by step, if possible including scripts you used, for downloading and using NLTK?

      1 Reply Last reply Reply Quote 0
      • ccc
        ccc last edited by

        See the PyPI Modules section of https://github.com/Pythonista-Tools

        1 Reply Last reply Reply Quote 0
        • ltddev
          ltddev last edited by

          There are two parts to NLTK, Natural Language Toolkit. There is the NLTK libraries but there is also the various data packages (corpora) this library uses. The above mentioned script will download and install the library, but not the corpora. To download and install corpora, you import nltk and then do a:

          nltk.download()
          

          either from the command prompt or in a script. Outside of Pythonista where download() finds a graphical interface (TkInter) it launches a GUI-based installer. If it does not find Tkinter, as is the situation in Pythonista, it instead launches a command-line version that accepts one letter commands to list, select and download any and all available corpora.

          Once you have the main libraries which are pure Python, have downloaded the corpora/data, you will need to do one further thing to actually use NLTK and corpora from Pythonista. You need to set an environment variable that points to the NLTK_DATA or the root directory of the installed corpora, IF you installed them to a location not automatically searched. NLTK will expect this data root to be off the Pythonista app itself, not to Documents directory which is a subdir in it. You can either use an external tool like iFunbox or an internal one like iFile available from Cydia for jailbroken devices, to move the nltk data directory to the Pythonista app. Alternatively, in a script that wants to actually use the corpora you will need to set the environment variable NLTK__DATA to the location of the corpora.

          1 Reply Last reply Reply Quote 0
          • cheseremtitus
            cheseremtitus last edited by

            I've tried to get up an running with NLTK through installer script from pypi modules and it throws the following errors on attempted install under python 2.7.

            • ProtocolError: <ProtocolError for pypi.python.org/pypi: 403 [[[!!! BREAKING CHANGE !!!]]] Support for clients that do not support Server Name Indication is temporarily disabled and will be permanently deprecated soon. See https://status.python.org/incidents/hzmjhqsdjqgb and https://github.com/pypa/pypi-support/issues/978 [[[!!! END BREAKING CHANGE !!!]]]>

            I tried using pip install from stash but it failed while installing the regex module as it contains C code that required compiling.

            Any work around would be greatly appreciated.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Powered by NodeBB Forums | Contributors