ImportError:没有名为google_compute_engine的模块

问题描述 投票:8回答:3

我使用谷歌云平台的谷歌计算引擎,我想将我的数据存储在谷歌存储中,所以我用gsutil将数据从计算引擎发送到谷歌存储

在我将python2.6.6更新为python2.7之前,gsutil工作正常。但更新到2.7后

enter image description here

我花了很多时间......

P.S我使用CenOS6.7

python-2.7 google-compute-engine google-cloud-platform centos6 gsutil
3个回答
22
投票

我有完全相同的问题,我通过删除boto设置解决了它:

sudo rm -f /etc/boto.cfg

10
投票

这与this问题有关。

可以通过在运行export BOTO_CONFIG=/dev/null之前运行gsutil来解决


1
投票

这对我有用:

vim /etc/boto.cfg

找到它所说的指令:

[Plugin]
plugin_directory = /usr/lib/python3/dist-packages/google_compute_engine/boto

并通过将plugin_directory放在线的开头来评论#

[Plugin]
#plugin_directory = /usr/lib/python3/dist-packages/google_compute_engine/boto

或者,在同一命令中设置BOTO_CONFIG环境变量:

BOTO_CONFIG=/dev/null gsutil <your command here> ...

© www.soinside.com 2019 - 2024. All rights reserved.