0
votes

I am currently trying to create bucket in the Google Cloud Storage using Python and the documentation provided by Google here at this link.

https://cloud.google.com/storage/docs/gspythonlibrary

I have followed the instructions and I have successfully install the stand alone gsutil. However, once I go into eclipse and import gcs_oauth2_boto_plugin, it does not recognize it even though it recognizes the import boto.

1
Can you import gcs_oauth2_boto_plugin outside of Eclipse? Is gcs_oauth2_boto_plugin on your PYTHONPATH? - Travis Hobrla
I do not know what you mean? Where is my PYTHONPATH? How do i change it? - Adrian Humphrey
docs.python.org/2/using/cmdline.html#environment-variables describes some of the basics. In short, if you're going to import a module, it needs to be visible to the Python interpreter that you're using. - Travis Hobrla

1 Answers

0
votes

It was a problem with both my PYTHON PATH and Eclipse. What I ended up doing was

import sys
sys.path.append("/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages")
try:
   import boto
   from boto import connect_gs
except:
   print 'neither of the modules were imported'

This solved my problem. Updating the python path did not.