Installing Python3 & pip in AWS EC-2 Instance

In this article we will see how to install python 3 and python pip in AWS EC-2 instance. CentOS 7

First step

Installing epel repository

[root@mail centos]# yum -y install epel-release

Installing python3

[root@mail centos]# yum -y install python3

Then download the script from pypa.io

[root@mail centos]# curl -O https://bootstrap.pypa.io/get-pip.py
   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                  Dload  Upload   Total   Spent    Left  Speed
 100 1842k  100 1842k    0     0  6600k      0 --:--:-- --:--:-- --:--:-- 6604k

To install pip for everyone type the following command

[root@mail centos]# python3 get-pip.py
Collecting pip
Downloading pip-20.3.3-py2.py3-none-any.whl (1.5 MB)
|████████████████████████████████| 1.5 MB 14.9 MB/s
Collecting wheel
Downloading wheel-0.36.2-py2.py3-none-any.whl (35 kB)
Installing collected packages: pip, wheel
Attempting uninstall: pip
Found existing installation: pip 9.0.3
Uninstalling pip-9.0.3:
Successfully uninstalled pip-9.0.3
WARNING: The scripts pip, pip3 and pip3.6 are installed in '/usr/local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The script wheel is installed in '/usr/local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-20.3.3 wheel-0.36.2

Add the executable path, ~/.local/bin, to your PATH variable

[root@mail centos]# export PATH=/usr/local/bin:$PATH

Now you should be able to call pip directly

[root@mail centos]# pip --version
pip 20.3.3 from /usr/local/lib/python3.6/site-packages/pip (python 3.6)

Done

Thank you for viewing my article.
If you like what i am doing , please subscribe to my youtube channel and comment. Let me know if you would like to see an article of your choice.
Please share with your friends and family.

Thanks,

Salman Francis

https://www.youtube.com/linuxking
https://www.tekco.net
https://www.facebook.com/linuxking77
Twitter: @linuxking77
Instagram: linuxking77

Leave a Comment

Your email address will not be published. Required fields are marked *