如何在Google Cloud Console上安装python 3? [英] How do I install python 3 on google cloud console?

查看:76
本文介绍了如何在Google Cloud Console上安装python 3?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始使用Google Cloud Console.我已经创建了一个VM(Red Hat Enterprise Linux 7).预先安装了Python 2.7.如何更新到Python 3?同样,"pip install"不起作用;我假设一旦更新,它将随Python 3一起提供.

I'm just getting started in the Google Cloud Console. I've created a VM (Red Hat Enterprise Linux 7). Python 2.7 comes preinstalled. How do I update to Python 3? Also 'pip install' doesn't work; I'm assuming that will come with Python 3 once I get that updated.

推荐答案

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

RHEL 7 running on GCE VM is mostly identical to RHEL 7 running on your own physical server.

要注意的一件事是,默认情况下,在GCE Vms上,您通过ssh进入虚拟机的默认帐户启用了无密码sudo.

One thing to be aware is that by default on GCE Vms, passwordless sudo is enabled with the default account you ssh into the VM.

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

Once you ssh into the VM (either from the browser or using gcloud compute ssh), you can follow these steps:

# 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

这篇关于如何在Google Cloud Console上安装python 3?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆