Arun
Arun

Reputation: 770

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. 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.

[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

Upvotes: 0

Views: 1035

Answers (1)

jordanm
jordanm

Reputation: 35014

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 \*bin/2to3

When I ran this on Amazon Linux, I found the following packages: python27-tools and python36-tools.

If it were not available in any packages, you could install this using pip:

sudo pip install 2to3

Upvotes: 1

Related Questions