|
| 1 | +{ |
| 2 | + "cells": [ |
| 3 | + { |
| 4 | + "cell_type": "markdown", |
| 5 | + "metadata": {}, |
| 6 | + "source": [ |
| 7 | + "# Install Python\n", |
| 8 | + "\n", |
| 9 | + "## Mac\n", |
| 10 | + "\n", |
| 11 | + "See <https://www.python.org/downloads/> (current version is 3.6.4).\n", |
| 12 | + "\n", |
| 13 | + "\n", |
| 14 | + "## Linux\n", |
| 15 | + "\n", |
| 16 | + "Open Terminal and check current version with `python --version` or `python3 --version`. If 3.4 or 3.5, you're fine. If Python version is out of date, run these:\n", |
| 17 | + "\n", |
| 18 | + "``` bash\n", |
| 19 | + "$ curl -O https://raw.githubusercontent.com/kylepjohnson/python3_bootstrap/master/install.sh\n", |
| 20 | + "$ chmod +x install.sh\n", |
| 21 | + "$ ./install.sh\n", |
| 22 | + "```\n", |
| 23 | + "\n", |
| 24 | + "This Linux build from source will take around 5 minutes." |
| 25 | + ] |
| 26 | + }, |
| 27 | + { |
| 28 | + "cell_type": "markdown", |
| 29 | + "metadata": {}, |
| 30 | + "source": [ |
| 31 | + "# Install Git\n", |
| 32 | + "\n", |
| 33 | + "The CLTK uses Git for corpus management. For Mac, install it from here: <https://git-scm.com/downloads>. For Linux, check if present (`git --version`); if not then use your package manager to get it (e.g., `apt-get install git`)." |
| 34 | + ] |
| 35 | + }, |
| 36 | + { |
| 37 | + "cell_type": "markdown", |
| 38 | + "metadata": {}, |
| 39 | + "source": [ |
| 40 | + "# Create a virtual environment\n", |
| 41 | + "\n", |
| 42 | + "This makes a special environment (a \"sandbox\") just for the CLTK. If something goes wrong, you can just delete it and start again.\n", |
| 43 | + "\n", |
| 44 | + "``` bash\n", |
| 45 | + "$ cd ~/\n", |
| 46 | + "$ mkdir cltk\n", |
| 47 | + "$ cd cltk\n", |
| 48 | + "$ pyvenv venv\n", |
| 49 | + "$ source venv/bin/activate\n", |
| 50 | + "```\n", |
| 51 | + "\n", |
| 52 | + "Now you can see that you're not using your system Python but this particular one:\n", |
| 53 | + "\n", |
| 54 | + "``` bash\n", |
| 55 | + "$ which python\n", |
| 56 | + "```\n", |
| 57 | + "\n", |
| 58 | + "Note that every time you open a new Terminal window, you'll need to \"activate\" this environment with `source ~/cltk/venv/bin/activate`." |
| 59 | + ] |
| 60 | + }, |
| 61 | + { |
| 62 | + "cell_type": "markdown", |
| 63 | + "metadata": {}, |
| 64 | + "source": [ |
| 65 | + "# Install CLTK\n", |
| 66 | + "\n", |
| 67 | + "``` bash\n", |
| 68 | + "$ pip install cltk\n", |
| 69 | + "```\n", |
| 70 | + "\n", |
| 71 | + "This will take a few minutes, as it will install several \"dependencies\", being other Python libraries which the CLTK uses.\n", |
| 72 | + "\n", |
| 73 | + "Also install Jupyter, which is a really handy way of writing code.\n", |
| 74 | + "\n", |
| 75 | + "``` bash\n", |
| 76 | + "$ pip install jupyter\n", |
| 77 | + "```" |
| 78 | + ] |
| 79 | + }, |
| 80 | + { |
| 81 | + "cell_type": "markdown", |
| 82 | + "metadata": {}, |
| 83 | + "source": [ |
| 84 | + "# Test Jupyter\n", |
| 85 | + "\n", |
| 86 | + "From your `cltk` directory, launch a notebook (such as this one) from the Terminal with `jupyter notebook`. Then open your preferred browser to <http://localhost:8888>." |
| 87 | + ] |
| 88 | + }, |
| 89 | + { |
| 90 | + "cell_type": "markdown", |
| 91 | + "metadata": {}, |
| 92 | + "source": [ |
| 93 | + "# Download these tutorials\n", |
| 94 | + "\n", |
| 95 | + "You may find these instructions at <https://github.com/cltk/tutorials>." |
| 96 | + ] |
| 97 | + }, |
| 98 | + { |
| 99 | + "cell_type": "markdown", |
| 100 | + "metadata": {}, |
| 101 | + "source": [ |
| 102 | + "# Join GitHub\n", |
| 103 | + "\n", |
| 104 | + "GitHub is a nice way to share code. Come visit us at <https://github.com/cltk/cltk/>!" |
| 105 | + ] |
| 106 | + } |
| 107 | + ], |
| 108 | + "metadata": { |
| 109 | + "kernelspec": { |
| 110 | + "display_name": "Python 3", |
| 111 | + "language": "python", |
| 112 | + "name": "python3" |
| 113 | + }, |
| 114 | + "language_info": { |
| 115 | + "codemirror_mode": { |
| 116 | + "name": "ipython", |
| 117 | + "version": 3 |
| 118 | + }, |
| 119 | + "file_extension": ".py", |
| 120 | + "mimetype": "text/x-python", |
| 121 | + "name": "python", |
| 122 | + "nbconvert_exporter": "python", |
| 123 | + "pygments_lexer": "ipython3", |
| 124 | + "version": "3.6.4" |
| 125 | + } |
| 126 | + }, |
| 127 | + "nbformat": 4, |
| 128 | + "nbformat_minor": 1 |
| 129 | +} |
0 commit comments