Amazon linux install pip

How do I install Python 3 on an AWS EC2 instance?

I’ve googled around and I can’t find anyone else who has this problem so I’m asking here. Do I have to manually download and install it?

Possibly yes, it may not yet be available for Amazon Linux (or clarify if you’re using a different OS).

Hi, yes it’s the ‘standard’ Amazon Linux OS. Happy to manually install but there are a few things missing ( and I thought it best to check before spending time messing about 🙂

12 Answers 12

sudo yum list | grep python3 

you will see that while they don’t have a «python3» package, they do have a «python34» package, or a more recent release, such as «python36». Installing it is as easy as:

sudo yum install python34 python34-pip 

This seems to be the simpler answer. Did AWS update their packages between when @Jake_Howard posted an answer and you did?

@SohanShirodkar you may have been unlucky and just caught a new release — their September release moved to python35 . here’s where you can see the newest releases: aws.amazon.com/amazon-linux-ami/#Release_Notes

In 2018, sudo yum install python36 is also available. also don’t forget to install latest pip: python3 -m pip install —user —upgrade pip and then you can python3 -m pip install —user virtualenv for a virtual env. ref: packaging.python.org/guides/installing-using-pip-and-virtualenv

Note: This may be obsolete for current versions of Amazon Linux 2 since late 2018 (see comments), you can now directly install it via yum install python3 .

In Amazon Linux 2, there isn’t a python36 in the default yum repos, instead there’s the Amazon Extras Library.

sudo amazon-linux-extras install python3 

If you want to set up isolated virtual environments with it; using yum install ‘d virtualenv tools don’t seem to reliably work.

virtualenv --python=python3 my_venv 

Calling the venv module/tool is less finicky, and you could double check it’s what you want/expect with python3 —version beforehand.

Other things it can install (versions as of 18 Jan 18):

[ec2-user@x ~]$ amazon-linux-extras list 0 ansible2 disabled [ =2.4.2 ] 1 emacs disabled [ =25.3 ] 2 memcached1.5 disabled [ =1.5.1 ] 3 nginx1.12 disabled [ =1.12.2 ] 4 postgresql9.6 disabled [ =9.6.6 ] 5 python3=latest enabled [ =3.6.2 ] 6 redis4.0 disabled [ =4.0.5 ] 7 R3.4 disabled [ =3.4.3 ] 8 rust1 disabled [ =1.22.1 ] 9 vim disabled [ =8.0 ] 10 golang1.9 disabled [ =1.9.2 ] 11 ruby2.4 disabled [ =2.4.2 ] 12 nano disabled [ =2.9.1 ] 13 php7.2 disabled [ =7.2.0 ] 14 lamp-mariadb10.2-php7.2 disabled [ =10.2.10_7.2.0 ] 

@NickT python3-3.7.2-4.amzn2.0.1.x86_64 is actually installed through ‘yum install python3’ you don’t use amazon linux extras anymore for python

Читайте также:  Remove user linux from group

Here are the steps I used to manually install python3 for anyone else who wants to do it as it’s not super straight forward. EDIT: It’s almost certainly easier to use the yum package manager (see other answers).

Note, you’ll probably want to do sudo yum groupinstall ‘Development Tools’ before doing this otherwise pip won’t install.

wget https://www.python.org/ftp/python/3.4.2/Python-3.4.2.tgz tar zxvf Python-3.4.2.tgz cd Python-3.4.2 sudo yum install gcc ./configure --prefix=/opt/python3 make sudo yum install openssl-devel sudo make install sudo ln -s /opt/python3/bin/python3 /usr/bin/python3 python3 (should start the interpreter if it's worked (quit() to exit) 

Источник

How to Install pip3 in Amazon Linux 2

As a data scientist or software engineer you may find yourself working with Amazon Linux 2 a popular choice for cloud computing and data analysis One of the necessary tools for Python development is pip the package installer for Python However pip may not be installed by default in Amazon Linux 2 which can make it challenging to install packages and libraries

As a data scientist or software engineer, you may find yourself working with Amazon Linux 2, a popular choice for cloud computing and data analysis. One of the necessary tools for Python development is pip, the package installer for Python. However, pip may not be installed by default in Amazon Linux 2, which can make it challenging to install packages and libraries.

In this guide, we will walk you through the steps to install pip3 in Amazon Linux 2, allowing you to install Python packages and libraries with ease.

What is pip3?

Before we dive into the installation process, let’s briefly discuss what pip3 is and why it is essential for Python development. Pip is a package installer that allows you to install, upgrade, and manage Python packages and libraries. It is a command-line tool that interacts with the Python Package Index (PyPI), a repository of software packages for Python.

Pip3 is the latest version of pip and is designed to work specifically with Python 3. It is the recommended package installer for Python 3 and comes pre-installed with many Python distributions. However, if you are working with Amazon Linux 2, you may need to install pip3 manually.

Читайте также:  Linux увеличить количество сокетов

How to Install pip3 in Amazon Linux 2

To install pip3 in Amazon Linux 2, follow these steps:

  1. Open a terminal window on your Amazon Linux 2 instance.
  2. Update the package manager by running the following command:
sudo yum install python3-pip 

Congratulations! You have successfully installed pip3 in Amazon Linux 2. You can now use pip3 to install Python packages and libraries.

Conclusion

In conclusion, pip3 is an essential tool for Python development, allowing you to install, upgrade, and manage Python packages and libraries. If you are working with Amazon Linux 2, you may need to install pip3 manually. Fortunately, the process is straightforward, and you can easily install pip3 by following the steps outlined in this guide.

We hope this guide has been helpful in showing you how to install pip3 in Amazon Linux 2. If you have any questions or comments, please feel free to leave them below.

Источник

how to install pip with yum on EC2

I am use AWS with REL 7. the default EC2 mico instance has already install python. but it encounter below error when i try to install pip by yum.

sudo yum install pip

Loaded plugins: amazon-id, rhui-lb, search-disabled-repos No package pip available. Error: Nothing to do Anyone advise on how to install pip with yum?

9 Answers 9

The following worked for me on Amazon Linux AMI 2:

sudo yum -y install python-pip

To install pip3.6 in Amazon Linux., there is no python36-pip. If you install python34-pip, it will also install python34 and point to it.

The best option that worked for me is the following:

#Download get-pip to current directory. It won't install anything, as of now curl -O https://bootstrap.pypa.io/get-pip.py #Use python3.6 to install pip python3 get-pip.py #this will install pip3 and pip3.6 

Based on your preference, if you like to install them for all users, you may choose to run it as ‘sudo’

Worked like a charm.. in my case, Amazon linux has default Python version 2.7.14. Hence the second command was sudo python get-pip.py

You can see what is available by executing

. python2-pip.noarch : A tool for installing and managing Python 2 packages python3-pip.noarch : A tool for installing and managing Python3 packages 

So, you can install the version that you need. Since the default instance seems to have Python 2 installed, you probably want python2-pip . Thus:

sudo yum install python2-pip 

if you have already installed python you might want to install pip by: sudo yum install python(«version»)-pip for example:

sudo yum install python34-pip 

still cannot find package. $ sudo yum install python34-pip Loaded plugins: amazon-id, rhui-lb, search-disabled-repos rhui-REGION-client-config-server-7 | 2.9 kB 00:00 rhui-REGION-rhel-server-releases | 3.5 kB 00:00 rhui-REGION-rhel-server-rh-common | 3.8 kB 00:00 (1/2): rhui-REGION-rhel-server-releases/7Server/x86_64/upd | 1.9 MB 00:00 (2/2): rhui-REGION-rhel-server-releases/7Server/x86_64/pri | 38 MB 00:01 No package python34-pip available. Error: Nothing to do

this the version what i used now:]$ sudo yum list python Loaded plugins: amazon-id, rhui-lb, search-disabled-repos Installed Packages python.x86_64 2.7.5-48.el7 @anaconda/7.3

try different version of python. if you have python python-2.7.5. you need to install pip of that version.

cannot find I try to list and grep[ec2-user@ip-172-31-26-241 ~]$ sudo yum list|grep python|grep pip [ec2-user@ip-172-31-26-241 ~]$

Источник

Install Python, pip, and the EB CLI on Linux

The EB CLI requires Python 2.7, 3.4, or later. If your distribution didn’t come with Python, or came with an earlier version, install Python before installing pip and the EB CLI.

To install Python 3.7 on Linux
Note

If your Linux distribution came with Python, you might need to install the Python developer package to get the headers and libraries required to compile extensions and install the EB CLI. Use your package manager to install the developer package (typically named python-dev or python-devel ).

$ sudo apt-get install python3.7
$ sudo yum install python37
$ sudo zypper install python3-3.7
$ python3 --version Python 3.7.3

Install pip by using the script provided by the Python Packaging Authority, and then install the EB CLI.

To install pip and the EB CLI
$ curl -O https://bootstrap.pypa.io/get-pip.py
$ python3 get-pip.py --user Collecting pip Downloading pip-8.1.2-py2.py3-none-any.whl (1.2MB) Collecting setuptools Downloading setuptools-26.1.1-py2.py3-none-any.whl (464kB) Collecting wheel Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB) Installing collected packages: pip, setuptools, wheel Successfully installed pip setuptools wheel
    Find your shell’s profile script in your user folder. If you are not sure which shell you have, run echo $SHELL .
$ ls -a ~ . .. .bash_logout .bash_profile .bashrc Desktop Documents Downloads
  • Bash – .bash_profile , .profile , or .bash_login .
  • Zsh – .zshrc
  • Tcsh – .tcshrc , .cshrc or .login .
export PATH=LOCAL_PATH:$PATH
$ pip --version pip 8.1.2 from ~/.local/lib/python3.7/site-packages (python 3.7)
$ pip install awsebcli --upgrade --user
$ eb --version EB CLI 3.14.8 (Python 3.7)

To upgrade to the latest version, run the installation command again.

$ pip install awsebcli --upgrade --user

Источник

Оцените статью
Adblock
detector