如何在Google Cloud Console上安装python 3?
问题内容:
我刚刚开始使用Google Cloud Console。我已经创建了一个VM(Red Hat Enterprise Linux 7)。预先安装了Python
2.7。如何更新到Python 3?同样,“ pip install”不起作用;我假设一旦更新,它将随Python 3一起提供。
问题答案:
在GCE VM上运行的RHEL 7与在您自己的物理服务器上运行的RHEL 7大致相同。
要注意的一件事是,默认情况下,在GCE Vms上,使用您ssh进入VM的默认帐户启用了无密码sudo。
SSH(通过浏览器或使用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