简体   繁体   English

如何在Amazon Linux EC2上安装python 2to3

[英]How to install python 2to3 on Amazon Linux EC2

I want to install Python 2to3 tool on Amazon Linux but I am unable to install it. 我想在Amazon Linux上安装Python 2to3工具 ,但无法安装。 Please can someone help me with the steps. 请有人帮我做这些步骤。

I have tried the following but doesn't work. 我尝试了以下方法,但是不起作用。

[ec2-user@ip-10-0-0-11 ~]$ sudo yum install python-tools
Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main                                                                                                  | 2.1 kB  00:00:00
amzn-updates                                                                                               | 2.5 kB  00:00:00
1045 packages excluded due to repository priority protections
No package python-tools available.
Error: Nothing to do

I have the following versions of python installed. 我安装了以下版本的python。

[ec2-user@ip-10-0-0-11 bin]$ ls -rlt python*
-rwxr-xr-x 1 root root 5120 Nov  2 19:21 python2.6
-rwxr-xr-x 1 root root 5120 Nov  2 19:21 python26
-rwxr-xr-x 1 root root 1846 Jan 31 00:17 python2.7-config
-rwxr-xr-x 1 root root 5120 Jan 31 00:18 python2.7
-rwxr-xr-x 1 root root 5120 Jan 31 00:18 python27
-rwxr-xr-x 3 root root 6864 Feb  6 21:24 python3.4m
-rwxr-xr-x 3 root root 6864 Feb  6 21:24 python3.4
-rwxr-xr-x 3 root root 6864 Feb  6 21:24 python34
-rwxr-xr-x 3 root root 6872 Feb 19 21:58 python3.6m
-rwxr-xr-x 3 root root 6872 Feb 19 21:58 python3.6
-rwxr-xr-x 3 root root 6872 Feb 19 21:58 python36 
lrwxrwxrwx 1 root root    9 Feb 27 05:28 python2 -> python2.6 
lrwxrwxrwx 1 root root   25 Apr 19 03:00 python3 -> /etc/alternatives/python3
lrwxrwxrwx 1 root root   31 Apr 19 03:00 python-config -> /etc/alternatives/python-config
lrwxrwxrwx 1 root root   24 Apr 19 03:00 python -> /etc/alternatives/python

I have also tried below link but not of any help Python Link 我也尝试了下面的链接,但没有任何帮助Python链接

If you know the name of a command, you can use yum provides to see if it's available in any packages in the repo: 如果您知道命令的名称,则可以使用yum provides来查看它在回购中的任何软件包中是否可用:

yum provides \*bin/2to3

When I ran this on Amazon Linux, I found the following packages: python27-tools and python36-tools . 当我跑这对亚马逊的Linux,我发现下面的包: python27-toolspython36-tools

If it were not available in any packages, you could install this using pip : 如果没有任何软件包可用,则可以使用pip安装:

sudo pip install 2to3

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

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