Gsutil: ImportError: No module named google_compute_engine

Created on 5 Aug 2016  路  2Comments  路  Source: GoogleCloudPlatform/gsutil

Before i updated python2.6.6 to python2.7, gsutil was working fine.
But after update to 2.7 ,
and i also edited /usr/bin/yum to #!/usr/bin/python2.6

[root@instance-1 ~]# gsutil config Traceback (most recent call last): File "/usr/local/src/google-cloud-sdk/platform/gsutil/gsutil", line 22, in <module> gsutil.RunMain() File "/usr/local/src/google-cloud-sdk/platform/gsutil/gsutil.py", line 107, in RunMain import gslib.__main__ File "/usr/local/src/google-cloud-sdk/platform/gsutil/gslib/__main__.py", line 39, in <module> import boto File "/usr/local/src/google-cloud-sdk/platform/gsutil/third_party/boto/boto/__init__.py", line 1216, in <module> boto.plugin.load_plugins(config) File "/usr/local/src/google-cloud-sdk/platform/gsutil/third_party/boto/boto/plugin.py", line 93, in load_plugins _import_module(file) File "/usr/local/src/google-cloud-sdk/platform/gsutil/third_party/boto/boto/plugin.py", line 75, in _import_module return imp.load_module(name, file, filename, data) File "/usr/lib/python2.6/site-packages/google_compute_engine/boto/compute_auth.py", line 19, in <module> from google_compute_engine import logger ImportError: No module named google_compute_engine

Most helpful comment

thanks a lot
I solved this problem after i reinstall the google-compute-engine,
I think just like you said " Maybe boto was removed or move during the upgrade process"

All 2 comments

It looks like:

  • Gsutil is being run with the default Python binary, which is still 2.6 judging from the stack trace.
  • Boto is unable to find the google_compute_engine module. Maybe this was removed or move during the upgrade process? If you don't see the /usr/lib/python2.6/site-packages/google_compute_engine directory on your machine, or it's empty, etc., then you may want to try a clean install of google-compute-engine (note the dashes, not underscores) using yum or pip (making sure to run pip with python 2.6, assuming you want to use it rather than 2.7) as described in the README doc.

If that doesn't work, we'll need some more info to help narrow down the problem:

  • Is this a Compute Engine VM?
  • What OS are you running on (I assume CentOS 6 or similar because of yum and Python 2.6.X)?
  • How did you perform the upgrade from 2.6 -> 2.7?

thanks a lot
I solved this problem after i reinstall the google-compute-engine,
I think just like you said " Maybe boto was removed or move during the upgrade process"

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ilyavaiser picture ilyavaiser  路  11Comments

tispratik picture tispratik  路  4Comments

gdaughenbaugh picture gdaughenbaugh  路  6Comments

marchelbling picture marchelbling  路  5Comments

khavishbhundoo picture khavishbhundoo  路  7Comments