Setting up PiCloud

PiCloud is another cloud computing provider, which is actually using the EC2 Amazon infrastructure. However, they do offer environments with preinstalled Python software, including NumPy. These environments are just EC2 instances that we can ssh into. In this recipe, we will be using the Python 2.7—Ubuntu Natty 11.04 environment. For the installed packages in this environment, see http://www.picloud.com/docs/base_environment/2/installed/ . PiCloud follows the freemium model, meaning that you can start out for free and pay later on if you require more resources.

How to do it...

After the mandatory sign up, log in to PiCloud.

  1. Create an environment.

    We start out without any environments. In order to create an environment, first click on the Environments tab. Next, click on the "create a new environment button. Select the Python 2.7 base environment. Currently, you can choose between a Python 2.7 and 2.6 environments, both on Ubuntu.

    Creating an environment takes a few minutes. When the environment is ready, you will receive an e-mail, and you should see something like the following screenshot in your browser:

    How to do it...
  2. Connect to the environment.

    If we click on the connect link in the action column, we get a pop up with the following instructions:

    chmod 400 privatekey.pem
    ssh –i privateke
    y.pem [email protected]
    ws.com
    

    Download the private key using the link in the pop up. Follow the instructions further to connect to the environment.

  3. Check the versions.

    In order to prove that we can use NumPy, we will check the available version. We will do that for Matplotlib as well.

    First, let's start an IPython shell. Recall from Chapter 1 that the pylab switch allows us to auto-import several packages, including NumPy. Execute the following command:

    ipython -pylab
    

    NumPy and Matplotlib have a __version__ attribute, which tells us the version. Print the version attributes:

    In [1]: numpy.__version__
    Out[1]: '1.6.1'
    
    In [4]: matplotlib.__version__
    Out[4]: '1.0.1'
    

How it works...

PiCloud gives us preconfigured EC2 Amazon instances with NumPy and other Python packages. This gives us direct access from a terminal. We can customize our environment and save it for later. A customized environment can be used as a template as well.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset