Skip to content

Installation

Albert Espinosa edited this page May 5, 2020 · 32 revisions

Requirements

Optional Requirements

Memcached is needed if you want real caching, remember to install a python driver (pylibmc or python-memcached) and adjust your settings accordingly.

OS Installation Guide

Linux

  • Step One - Install python3.5, memcached, pip3, ipython and others.:
Ubuntu

(Tested on Ubuntu 16.10+)

    $ sudo apt-get update
    $ sudo apt-get install git python3.5 python3-all-dev python3-pylibmc python3-pip python3-dogpile.cache python3-dateutil python3-blinker memcached
    $ sudo apt-get install -y libmemcached-dev zlib1g-dev libssl-dev python-dev build-essential
Arch Linux
    # pacman -S memcached mongodb libmemcached boost
    # systemctl enable mongodb
    # systemctl start mongodb

Windows

(Tested on Windows 10)

  • Download and install Python 3 from here. Make sure Python is added to the PATH variable.
  • Download and install MongoDB from here. Make sure you start the service if it is not started automatically.

Mac OS Catalina

    $ pip3 install ipython
    $ brew tap mongodb/brew
    $ brew install mongodb-community@3.6
    $ echo 'export PATH="/usr/local/opt/mongodb-community@3.6/bin:$PATH"' >> ~/.zshrc
    $ brew services start mongodb/brew/mongodb-community@3.6

Get the code

  • Step Two - Clone marvin's repository:

Linux and Mac

    $ git clone git@github.com:BotDevGroup/marvin.git
    $ cd ./marvin

Windows

  • Install a Git client if you don't already have one. Examples: GitKraken, Git, SourceTree, git-control
  • Clone the following repository: git@github.com:BotDevGroup/marvin.git
  • Open a new command prompt or PowerShell prompt.
  • Navigate to the folder created when cloning.

Configure your bot settings

  • Step Three - Create and customize your settings.json file:

Copy default_settings.json and rename it to settings.json then open it with your favorite editor to customize it. Remember to set your Telegram bot token on telegram_token. Talk to (@BotFather) if you still don't have one.

Set-up your Python environment

  • Step Four - Install virtualenv:

Linux and Mac

    $ pip3 install virtualenv #sudo -H pip3 install virtualenv (if it doesn't work)
    $ virtualenv --python=$(which python3) venv

Windows

    C:\...\marvin> pip install virtualenv
    C:\...\marvin> virtualenv venv

You should now see a venv folder, you can verify this with:

Linux and Mac

    $ ls 

Windows

    C:\...\marvin> dir
  • Step Five - Activate virtualenv.:

Linux and Mac

    $ source venv/bin/activate

You should now see (venv) user@host:~$. This means you are within the virtual environment.

Windows

    C:\...\marvin> cmd /k .\venv\Scripts\activate

You should now see (venv) C:\...\marvin>. This means you are within the virtual environment.

Install bot

  • Step Six - Install the bot and its dependencies:

Remember that you should run this command only if you are within the virtual environment.

Linux and Mac

    (venv)$ python3 setup.py develop

Windows

    (venv) C:\...\marvin> python setup.py develop

Running marvin

Now that you have completed the installation steps, you can now continue with running marvin. (Click Here)