• Sales: 1-800-961-2888
  • Support: 1-800-961-4454

Python API Installation for Cloud Files


Note:  The Python language bindings here are no longer being actively developed.  We recommend using our Python SDK, pyrax, in its place when possible.  You can get more information on the Python SDK on our API documentation site.

Contents

Overview

This Tutorial will take us step by step through the installation of Cloud Files Python API; in both Windows and *nix Operating systems(Should be the same for MacOSX)

What we need

  • Keyboard & Mouse
  • Computer
  • An Internet Connection
  • Cloud Files Python API
  • Python (I am using 2.6 for the Windows and *nix Install.)
  • About 5 - 10 min. approx.

Windows Installation

In this tutorial we only cover how to install the Cloud Files Python API. For Installation steps for Python: the Language see Python's website for more info.

  • Head to our Git Hub.
  • Click Download.
  • Then Click the type of file you want to save it as. I suggest .zip
  • You will be prompted to save the file.
  • For the sake of this tutorial save it to the Desktop.
  • Once downloaded unpack the zip file; also onto the Desktop.
  • You should have a folder named something like this rackspace-python-cloudfiles-e8c1625ffa59d42c85215e5b176af1ba376df00b
  • Open Terminal and Navigate to that folder.
  • inside of the rackspace-python-cloudfiles-e8c1625ffa59d42c85215e5b176af1ba376df00b folder there should be a file called setup.py.
  • Run this command.
setup.py install

You should get some output from the console and then return to the command prompt.

*Nix Installation

In this tutorial we only cover how to install the Cloud Files Python API. For Installation steps for Python: the Language see Python's website for more info.

  • Head to our Git Hub.
  • Click Download.
  • Then Click the type of file you want to save it as. I suggest .tar.gz
  • You will be prompted to save the file.
  • For the sake of this tutorial save it to the Desktop.
  • Open Terminal
  • Once downloaded Lets move to your Desktop. Run these commands:
cd ~/Desktop

Now go ahead and untar. The command should look like this:

tar zxvf rackspace-python-cloudfiles-e8c1625ffa59d42c85215e5b176af1ba376df00b

This should unpack the files unto your desktop that number at the end may not match so please ensure you are using the right tar name you can use tab to auto complete this. Now go ahead and cd into the directory

cd rackspace-python-cloudfiles-e8c1625ffa59d42c85215e5b176af1ba376df00b

For Most RedHat Based distros its:

su

Enter Root Password then:

python setup.py install

For Debian Based Distros its:

sudo python setup.py install

Success?

Now for the fun part lets see if the install worked.

Open IDLE for *nix head to command line and type idle at the command line and it will execute the IDE. For Windows Head to start -> all programs -> python2.6 -> IDLE (Python GUI)

Then inside of the Idle Window type in:

>>> import cloudfiles

Hit enter if you get nothing in return. You were successful in installing the API!

>>> import cloudfiles
>>>

If you get something like this:

>>> import cloudfiles
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import cloudfiles
ImportError: No module named cloudfiles
>>> 

Something is wrong double check your library path is correct and the api files are saved in the right place. For more info on where your default library path is; please take a look at the python documentation for your operating system.



© 2011-2013 Rackspace US, Inc.

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License


See license specifics and DISCLAIMER

5 Comments

Getting an error trying to install
Traceback (most recent call last):
File "setup.py", line 2, in <module>
from setuptools import setup, find_packages

That is on Rackspace's Precise Pangolin Ubuntu installation

It looks like this article should also list python's "setuptools" package as a prerequisite. On Ubuntu, you can run these commands to install setuptools:

sudo apt-get update
sudo apt-get install python-setuptools

That should allow you to continue the installation.

Hello.

I've tried to install the cloudfiles api but the link you provided here leads to a non-existing page. After that, I've been to your github page and download the python binding (https://github.com/rackspace/pyrax). I've tried to used duplicity to get a backup but I got the following error message: "BackendException: This backend requires the cloudfiles library available from Rackspace." Do you guys have any clue of what is going on?

Thanks,

JV

Sorry JV. We missed updating this page, looks like. The pyrax library is meant to be a replacement for the python-cloudfiles library, which is no longer seeing active development. However, you can still access python-cloudfiles at a different location:

https://github.com/rackerlabs/python-cloudfiles

I'll get the link in this article updated. You should be able to use that to satisfy Duplicity's dependency.

Add new comment