This is a collection of “how to install things” supporting DIY AI series
Most of the software I use in DIY AI series has become a lot more user friendlier during last years. However, developing AI / ML systems will require to know how to use the console and installing some console tools. This story tries to collect all the links and manuals in one place.
Personally I use Mac but I will try to add information for other systems where possible.
- for Windows: https://www.bleepingcomputer.com/tutorials/windows-command-prompt-introduction/
- for Mac: http://www.macworld.co.uk/feature/mac-software/how-use-terminal-on-mac-3608274/
- for Linux: https://www.howtogeek.com/140679/beginner-geek-how-to-start-using-the-linux-terminal/
- on Windows, you are stuck to old-fashioned “download & double click approach”
- on Mac, install Homebrew — I use it the most unless mentioned otherwise
- on Linux, use your built-in package manager — for Ubuntu, it is apt
- for Windows, download and install from here: https://www.python.org/downloads/
- for Mac, use brew install python for Python 2.7 or brew install python3 for Python 3
- for Linux, use your package manager (apt-get install python3 or similar command)
Most Python projects include dependencies (specified in requirements.txt file) that can be installed via pip install command (after you have installed python).
Last but not least, I recommend a good Python IDE — the best one is PyCharm, just go here — https://www.jetbrains.com/pycharm/download/ — to download free community edition.
PyCharm will allow to to code your scripts, run them (via Ctrl + R) or debug (via Ctrl + D). If you are very new to Python or feel a bit rusty, I recommend taking a Python course from Codecademy (it is free!).
Python 2 vs Python 3
Python currently has two versions — 2 and 3, with small differences. The differences (and process of porting code from 2 to 3) is well describrd int he following articles:
When working with python 3 most of the tools are postfixed with letter 3 —
python3 and so on, which should be take in account when working with multiple python versions.
As you develop different applications in Python, you may face the issue when they require different packages, different versions of the same package or different environments. In Python world, this issue is fixed using
virtualenv package — a tool that allows creation of isolated Virtual Environments.
You can install virtualenv following the official guide here: https://virtualenv.pypa.io/en/stable/installation/ . To create a virtual environment in a particular folder, run
virtualenv .; if you need a different version of Python, pass the executable path as the
-p switch, like so:
virtualenv . -p /usr/local/bin/python3.
To use (start) virtualenv, you need to execute
source bin\activate (or
bin\activate.bat on Windows) — see explanation here: https://virtualenv.pypa.io/en/stable/userguide/ .
When virtualenv is activated, you will see an addition to your command prompt with virtual environment name:
(venv1) # ~/Documents/nn/venv
If you see this prompt, then all commands (pip, python, etc) will be executed in your virtualenv configuration and all packages will be installed locally.
In most cases,
bin/ folders created by virtualenv are put into .gitignore file.
Fann is Fast Artificial Neural Network package.
You should install fann from here — http://leenissen.dk/fann/wp/help/installing-fann/
For Mac, you can do brew install fann instead of installing manually.
Afterwards, you need to install python bindings — pip install fann2