** On the pip homepage, it was stated that pip is included in Pyhon 2.7.9 and later and Python 3.4 and later. ** **
pip included with Python
Python 2.7.9 and later (on the python2 series), and Python 3.4 and later include pip by default [1], so you may have pip already.
** Let's install Python with pip. ** **
Since Python will be built and installed on Linux, it is necessary to install the OpenSSL development package on which pip depends in advance.
yum install openssl-devel
If a confirmation is displayed on the way, enter "y" and press enter.
When the installation is complete, you will see a nice message.
By the way, if OpenSSL for development is not included, this message will be displayed when installing Python. Of course, pip cannot be used either.
Ignoring ensurepip failure: pip 6.0.8 requires SSL/TLS
Open the Python home page.
https://www.python.org/
Select Downloads
→ Python 3.4.3
and Python 2.7.9
from the menu to download the compressed source code to any location.
Please unzip it after downloading.
Python-2.7.9.tar.xz
Python-3.4.3.tar.xz
Install it in / usr / local
.
cd Python-2.7.9
./configure --prefix=/usr/local
make
make altinstall
** I get some warnings during compilation, but it doesn't seem to have any fatal errors. However, the installation completion message is not displayed after the installation is completed. ** **
I'm curious, so when I look at the installation destination, there is no pip executable file as expected.
It is impossible to try to execute pip.
pip2.7
It can't be helped, so let's add pip manually.
python2.7 -m ensurepip
Install this module ʻensure pip` if pip is not included. It is a program that does nothing if pip is already included.
It completed normally and the pip executable file was created.
Although it says Downloading
during installation, the official documentation saysthis module does not access the internet. All required components are included in the package. Claims
.
It doesn't seem to have been downloaded from the net.
https://docs.python.org/2/library/ensurepip.html
Note:
This module does not access the internet. All of the components needed to bootstrap pip are included as internal parts of the package.
I was able to execute it.
pip2.7
** There are some parts that are not surprising, but for the time being, let's do it. ** **
This will also be installed in / usr / local
.
cd Python-3.4.3
./configure --prefix=/usr/local
make
make altinstall
As expected, it is the current mainstream. As far as I can see, there are no errors or warnings. A successfully installed message is also displayed.
An executable file for pip has also been created.
I was able to execute it without any problems.
pip3.4
You have now confirmed that the latest version of Python includes pip and can be installed at the same time as Python. Thank you for your hard work.
Recommended Posts