pythongoogle-app-enginegoogle-cloud-pythongcloud-python

Google Cloud and Appengine Python Package conflict


I'm going through google's appengine tutorials and made the simple example of posting a form ans retrieving the information. Through the tutorial steps I had to install Google Cloud SDK with the appengine libs.

It works fine.

One step forward I pip installed "google-cloud" package, to retrieve a file from Google Storage.

After installed both google cloud packages,when trying a simple import from my main.py file as:

from google.cloud import storage

I get the error:

ImportError: No module named google.cloud.storage

Printing google.__path__ I can see the correct path to both packages:

[
'/home/xpto/.virtualenvs/dev01/local/lib/python2.7/site-packages/google',
'/home/xpto/.virtualenvs/dev01/lib/python2.7/site-packages/google', 
'/home/xpto/Software/google-cloud-sdk/platform/google_appengine/google', 
'/home/xpto/projects/testProject01/lib/google'
]

What am I missing here?

Running python from the terminal in the same virtualenv I can import google.clou packages without problem. The error message appears only when I run it using dev_appserver.py


Solution

  • The problem was that I installed Google Cloud SDK using the Linux tar.gz package instead of the Debian/Ubuntu installation procedure.

    Somehow the tar.gz package messed up my python path. Creating a new environment solved.