08.06.2015 Views

Building Machine Learning Systems with Python - Richert, Coelho

Building Machine Learning Systems with Python - Richert, Coelho

Building Machine Learning Systems with Python - Richert, Coelho

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 12<br />

Therefore, we will be calling the ssh command and passing it the key files that we<br />

downloaded earlier as the identity (using the -i option). We are logging in as user<br />

ec2-user at the machine <strong>with</strong> the address ec2-54-244-194-143.us-west-2.<br />

conompute.amazonaws.com. This address will, of course, be different in your case.<br />

If you choose another distribution for your instance, the username may also change.<br />

In any case, the web panel will give you the correct information.<br />

Finally, if you are running an Unix-style operating system (including Mac OS), you<br />

may have to tweak its permissions by calling the following code:<br />

chmod 600 awskeys.pem<br />

This sets the read/write permission for the current user only. SSH will otherwise<br />

give you an ugly warning.<br />

Now, you should be able to log in to your machine. If everything is OK, you should<br />

see the banner as shown in the following screenshot:<br />

This is a regular Linux box where you have the sudo permission; you can run any<br />

command as the super user by prefixing it <strong>with</strong> sudo. You can run the update<br />

command it recommends to get your machine up to speed.<br />

Installing <strong>Python</strong> packages on Amazon Linux<br />

If you preferred another distribution, you can use your knowledge of that<br />

distribution to install <strong>Python</strong>, NumPy, and others. Here, we will do it on the<br />

standard Amazon distribution. We start by installing several basic <strong>Python</strong><br />

packages as follows:<br />

sudo yum -y install python-devel python-dev python-pip numpy scipy<br />

python-matplotlib<br />

For compiling mahotas, we will also need a C++ compiler:<br />

sudo yum -y install gcc-c++<br />

[ 253 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!