Install dependencies - A7F/mtg-telegram-assistant GitHub Wiki

installing for pros

Since you're a pro you shouldn't even read this section which is a veeery slow, step by step guide. However, here is what you're gonna need to run the bot on your machine:

  • python 3.8 (notice that you will have issues with older python versions because AIOHTTP 3.x.x requires a version newer than 3.5)
  • pip3 linked to python 3.8
  • peewee, scrython, and their dependencies
  • python-telegram-bot

also because scrython performs HTTP POST/GET requests, you maybe gonna need buld-essential, libssl-dev, libffi-dev and python3-dev. You can find the requirements file in the config folder.

installing for us, mere mortals

installing on linux

(FYI: I reproduced these steps on my server and everything went good, so yea, it should be the same with you... at least, that's what I hope)

If you already have python 3.6 and git, start from point 3; however, notice that the command on point 2 also installs buld-essential, libssl-dev, libffi-dev and python3-dev so you may need them.

  1. Let's start with git, which we will use to clone this repo on your machine

sudo apt-get install git

  1. install python 3.8 and aiohttp dependencies

sudo apt-get install python3.8 build-essential libssl-dev libffi-dev python3-dev -y

  1. let's clone this repo. Mind that the following command will clone everything inside your current working directory, so if you want a different path, just cd into your favourite folder

git clone https://github.com/A7F/mtg-telegram-assistant.git

  1. We now need pip for python3. If you started from scratch, move on to step 4-v.

    1. Be careful: if you already have python<3.5, you need to replace it with a newer version! Otherwise, you won't be able to compile aiohttp, resulting an installation failed error. Pip3 installs itself by default in your python3 folder so you won't be able to add a new pip3 inside another python3 folder, pip3 will tell you that in fact it is already installed! Here are some useful commands to check if you're okay:

      python3 --version

      whereis python3

      pip3 --version

    2. let's install pip3.

      sudo apt-get -y install python3-pip

  2. install bot dependencies with pip

cd ./mtg-telegram-assistant/config && pip install -r requirements.txt

  1. go back to the bot's main folder

cd ..

Installing on Windows

  1. download python 3.8 and install it. Mind to leave the option "add to PATH" checked. It also comes with pip, so you won't need anything else.

  2. download and install git, add it to PATH as you did before (it should be asked during the installation process).

  3. open powershell, move to the folder you want to put the bot. Clone this project using git

git clone https://github.com/A7F/mtg-telegram-assistant.git

  1. install bot dependencies with pip

cd ./mtg-telegram-assistant/config

pip install -r requirements.txt

  1. go back to the bot's main folder

cd ..