简体   繁体   English

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

[英]How do I install python 3 on google cloud console?

I'm just getting started in the Google Cloud Console.我刚刚开始使用 Google Cloud Console。 I've created a VM (Red Hat Enterprise Linux 7).我创建了一个 VM(Red Hat Enterprise Linux 7)。 Python 2.7 comes preinstalled.预装了 Python 2.7。 How do I update to Python 3?如何更新到 Python 3? Also 'pip install' doesn't work; 'pip install' 也不起作用; I'm assuming that will come with Python 3 once I get that updated.我假设一旦我得到更新,它就会随 Python 3 一起出现。

RHEL 7 running on GCE VM is mostly identical to RHEL 7 running on your own physical server.在 GCE VM 上运行的 RHEL 7 与在您自己的物理服务器上运行的 RHEL 7 基本相同。

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.需要注意的一件事是,默认情况下,在 GCE Vms 上,使用您通过 ssh 进入 VM 的默认帐户启用了无密码 sudo。

Once you ssh into the VM (either from the browser or using gcloud compute ssh ), you can follow these steps:一旦您通过 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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM