Search This Blog

Showing posts with label pip. Show all posts
Showing posts with label pip. Show all posts

Wednesday, April 3, 2013

How to install Rackspace Python SDK for cloud

The full summary of all posts for API Rackspace challenge can be found here:
Rackspace api-challenge summary

The Python SDK is available here. It is very simple to install it in any modern Linux distribution.
 
aptitude install python-pip
pip install pyrax

In Windows we need to do couple things more.
  • Download and install the distribute Python package

  • Use your browser to download the file or if you want to use curl in Windows take a look at  this instructions Powershell as Bash substitute on Windows. From powershell it can look like this:
     
    PS C:\Users\radoslaw> curl -O http://python-distribute.org/distribute_setup.py
    PS C:\Users\radoslaw> python distribute_setup.py
    

  • Download and install the pip Python package 
  •  
    PS C:\Users\radoslaw> curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
    PS C:\Users\radoslaw> python get-pip.py
    

  • Check that you can execute pip from command line

  • If you have to modify your PATH variable this blog can be helpful.
     
    PS C:\Users\radoslaw> pip
    
    Usage:
      pip  [options]
    ...
    

  • Lastly install pyrax SDK module and test it 

  • If everything went fine you should see similar output.
     
    PS C:\Users\radoslaw> python
    Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import pyrax
    >>> pyrax
    <module 'pyrax' from 'c:\Python27\lib\site-packages\pyrax\__init__.pyc'>
    
References
  1. http://docs.rackspace.com/sdks/guide/content/intro.html
  2. https://github.com/rackspace/pyrax/blob/master/docs/installing_pyrax.md
  3. https://pypi.python.org/pypi/distribute/#distribute-setup-py