1
votes

I am working on Ubuntu 14.04, 32 bit. I am getting this error in my Google App Engine server code:

import cloudstorage

ImportError: No module named cloudstorage

I ran this command to install the GCS module:

pip install GoogleAppEngineCloudStorageClient -t /home/john/software/google_appengine/lib/ --force-reinstall

My coworker installed the cloudstorage module on Windows 7 by simply copying the 'cloudstorage' folder to the GAE/lib folder. Running the code on his PC does not produce ImportError. I also tried this

How can I install the cloudstorage module on Linux to avoid the ImportError?

3
what version of python are you trying to install it for?Padraic Cunningham
@PadraicCunningham >>> sys.version '2.7.6 (default, Mar 22 2014, 22:59:38) \n[GCC 4.8.2]'cyrf
@Ashish I am having this same problem. Could you explain why are you suggesting installing Google Compute Engine? I don't want spurious files on my disk, in many cases without knowing how to delete them if it turns out they have nothing to do with solving the problem. So could you please explain what gcutil has to do with import cloudstorage producing the error message "No module named cloudstorage"? Thanks. (By the way, gcutil is deprecated.)Lindsay

3 Answers

5
votes

First you need to install the client, using svn you get the demos and test code:

Download: svn checkout http://appengine-gcs-client.googlecode.com/svn/trunk/python gcs-client

Then cd gcs-client/src and sudo/python or python setup.py install

You can use pip but you won't get the demos and test code:

pip install GoogleAppEngineCloudStorageClient -t <your_app_directory/lib>
5
votes

The library needs to be installed in your application directory. Docs suggest using PIP to put it in <app>/lib::

pip install GoogleAppEngineCloudStorageClient -t <your_app_directory/lib>

What they don't mention is that if you have to create a lib directory, you need to put an (empty) __init__.py in lib so that Python reads it as importable. You'll also need to say import lib.cloudstorage.

1
votes

Try this:

pip install GoogleAppEngineCloudStorageClient -t <app_root>

Then test if it works with:

python -c "import cloudstorage"