From 059085bc3131bf9d48e6cf1338b6da1f7715cf3f Mon Sep 17 00:00:00 2001 From: linuxdaemon Date: Tue, 12 Nov 2019 00:50:29 -0600 Subject: [PATCH] docs: Add install documentation --- README.md | 6 ++--- docs/installing/nix.md | 50 ++++++++++++++++++++++++++++++++++++++++++ docs/installing/win.md | 30 +++++++++++++++++++++++++ 3 files changed, 83 insertions(+), 3 deletions(-) create mode 100644 docs/installing/nix.md create mode 100644 docs/installing/win.md diff --git a/README.md b/README.md index 5b50275a0..1cb0e4ebc 100644 --- a/README.md +++ b/README.md @@ -20,9 +20,9 @@ New releases will be pushed from **python3.4** to **master** whenever we have a Firstly, CloudBot will only run on **Python 3.4 or higher**. Because we use the asyncio module, you will not be able to use any other versions of Python. -To install CloudBot on *nix (linux, etc), see [here](https://github.com/CloudBotIRC/CloudBot/wiki/Installing-on-*nix) +To install CloudBot on *nix (linux, etc), see [here](docs/installing/nix.md) -To install CloudBot on Windows, see [here](https://github.com/CloudBotIRC/CloudBot/wiki/Installing-on-Windows) +To install CloudBot on Windows, see [here](docs/installing/win.md) ### Running CloudBot @@ -59,7 +59,7 @@ If you think you have found a bug/have a idea/suggestion, please **open a issue* ## Changelog -See [CHANGELOG.md](https://github.com/CloudBotIRC/CloudBot/blob/master/CHANGELOG.md) +See [CHANGELOG.md](CHANGELOG.md) ## License diff --git a/docs/installing/nix.md b/docs/installing/nix.md new file mode 100644 index 000000000..7b14e4f18 --- /dev/null +++ b/docs/installing/nix.md @@ -0,0 +1,50 @@ +### Downloading + +#### Archive +Download CloudBot from [https://github.com/TotallyNotRobots/CloudBot/zipball/gonzobot.zip](https://github.com/TotallyNotRobots/CloudBot/archive/gonzobot.zip) and unzip, or execute the following commands: +```bash +curl -Ls https://github.com/TotallyNotRobots/CloudBot/archive/gonzobot.zip > CloudBot.zip +unzip CloudBot.zip +cd CloudBot-gonzobot +``` + +#### Git + +Alternately, you can also clone CloudBot by using: +```bash +git clone https://github.com/TotallyNotRobots/CloudBot.git +cd CloudBot +``` + +### Installing Dependencies + +All of CloudBot's python dependencies are stored in the `requirements.txt` file, and can be installed with pip. + +But first, you will need `git`, `python3.5-dev` and `libenchant1c2a`, `libxml2-dev`, `libxslt-dev` and `zlib1g-dev`. Install these with your system's package manager. + +For example, on a Debian-based system, you could use: +```bash +[sudo] apt-get install -y python3.5-dev git libenchant-dev libxml2-dev libxslt-dev zlib1g-dev +``` + +You will also need to install `pip`, which can be done by following [this guide](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#installing-pip) + +It is also recommended that you create a virtual environment for the bot to isolate it from system library updates. First, [install the venv package](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#installing-virtualenv) if required, and then [create the virtual environment](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment) + +We will refer to the virtual environment directory as `` from here on. + +Once the virtual environment is created, [activate it](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#activating-a-virtual-environment). + +Finally, install the python dependencies using `pip` using the following command in the CloudBot directory: +```bash +pip install -Ur requirements.txt +``` + +Now you are ready to run the bot! This can be done simply by executing the cloudbot module like so +```bash +python -m cloudbot +``` +or without activating the virtual environment, use +```bash +/bin/python -m cloudbot +``` diff --git a/docs/installing/win.md b/docs/installing/win.md new file mode 100644 index 000000000..3fd84a2de --- /dev/null +++ b/docs/installing/win.md @@ -0,0 +1,30 @@ +### Getting Ready + +We recommend that use you use a *unix system to run CloudBot in production, or Vagrant when developing CloudBot. However, it is possible to install natively on Windows. + +First, make sure you have Python 3.5 installed. It can be downloaded at [python.org](https://www.python.org/downloads/release/python-341/). + +Next, you need to install `pip`. + +You can usually install `pip` via the following python command in cmd: +``` +python3 -m ensurepip +``` + +If that doesn't work, follow [this guide](http://simpledeveloper.com/how-to-install-easy_install/) and then run `easy_install pip` in cmd. + +### Downloading + +Download CloudBot from [https://github.com/TotallyNotRobots/CloudBot/zipball/gonzobot.zip](https://github.com/TotallyNotRobots/CloudBot/archive/gonzobot.zip). + +Unzip the resulting file, and continue to read this document. + +### Installing Dependencies + +Before you can run the bot, you need to install a few Python dependencies. All of CloudBot's dependencies are stored in the `requirements.txt` file.` + +These can be installed with `pip` (The Python package manager) by running the following command in the bot directory: + + pip install -r requirements.txt + +Because installing `lxml` can be quite difficult on Windows (you may get errors running the command above) due to it requiring compilation, you can find a pre-built distribution at [http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml](http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml)