Install
=======


Installing requirements
-----------------------

Lets install python3 and mysql.

GNU/Linux
~~~~~~~~~

First of all to make sure that everything is up to date, let’s update and upgrade the system with apt-get.
::
    $ sudo apt-get update
    $ sudo apt-get -y upgrade
    
Probably python3 is already installed so let's check.
::
    
    $ python3 -V

If the command above returns something like ``Python 3.5.2`` it's all ok. Otherwise install python with the following command.
::
    $ sudo apt-get install python3

To manage software packages for Python, let’s install pip.
::
    $ sudo apt-get install -y python3-pip

A more detailed guide can be found on `Digital Ocean <https://www.digitalocean.com/community/tutorials/how-to-install-python-3-and-set-up-a-local-programming-environment-on-ubuntu-16-04>`_.

Installing MySQL can be done by runnung the following command.
::
    $ sudo apt-get install mysql-server
    
Windows
~~~~~~~

An easy guide regarding how to install python3 on windows can be found `here <http://www.openbookproject.net/courses/webappdev/units/softwaredesign/resources/install_python_win7.html>`_.

An easy way to install MySQL is provided by the XAMPP package.

Let's follow `this <https://www.wikihow.com/Install-XAMPP-for-Windows>`_ guide but in the step number 8 starts just MySQL.



Installing alchemist_lib
------------------------

Installing with ``pip``:
~~~~~~~~~~~~~~~~~~~~~~~~
If `python3-pip <https://en.wikipedia.org/wiki/Pip_(package_manager)>`_ is already installed::
        
    $ pip3 install <alchemist_lib-pack-name>
        
If you don't have pip installed, you can easily install it by downloading and running `get-pip.py <https://bootstrap.pypa.io/get-pip.py>`_.
    
Cloning the repository with ``git``:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If `git <https://en.wikipedia.org/wiki/Git>`_ is already installed::
        
    $ git clone <alchemist_lib-repo-link>
    $ cd <alchemist-repo-name>
    $ python3 setup.py install


After the installation it's important to specify mysql credentials::

    $ sudo alchemist populate -l "hostname" -u "username" -p "password" -d "database_name"

