如何在谷歌云控制台上安装python 3?

时间:2017-06-06 21:01:01

标签: python google-cloud-platform

我刚开始使用Google云端控制台。我创建了一个VM(Red Hat Enterprise Linux 7)。 Python 2.7已预装。如何更新到Python 3?另外' pip install'没有工作;我假设一旦我得到更新,它将随Python 3一起提供。

1 个答案:

答案 0 :(得分:0)

在GCE VM上运行的RHEL 7与在您自己的物理服务器上运行的RHEL 7大致相同。

有一件事需要注意的是,默认情况下,在GCE Vms上,无密码sudo会启用您在VM中使用的默认帐户。

一旦您进入虚拟机(从浏览器或使用gcloud compute ssh),您可以按照以下步骤操作:

# Install Python 3.4
sudo yum -y install python34

# Install python-setuptools which will bring in easy_install
sudo yum -y install python34-setuptools

# Install pip using easy_install
sudo easy_install-3.4 pip