Detailed explanation of upgrading Python and installing pip under Linux

Detailed explanation of upgrading Python and installing pip under Linux

Linux version upgrade:

1. First, confirm that the Python version that comes with the Linux operating system is consistent with the version you need

All Python versions are available at https://www.python.org/ftp/python/ Select Download

2. wget https://www.python.org/ftp/python/2.7.11/Python-2.7.11.tgz to download

3. Decompression

tar -zxvf Python-2.7.11.tgz

Enter the Python-2.7.11 directory and enter

  • ./configure
  • make
  • make install

4. Check whether the Python version is the system default version at this time

implement:

  • mv /usr/bin/python /usr/bin/python2.6
  • ln -s /usr/local/bin/python2.7 /usr/bin/python
  • Check again to see if the version you want to install has been updated

Pip Installation

1. A get-pip.py is provided in python; the following is the address

https://bootstrap.pypa.io/get-pip.py

2. Execute curl https://bootstrap.pypa.io/get-pip.py | python to download and install in Linux

This is very convenient. You can pack whatever you want.

Pip install xxx

Note: After upgrading the Python version, your yum command may not work because the yum command is written in Python.

# vi /usr/bin/yum #Open the yum command file and change the first line of script startup address 

Change it to /usr/bin/python2.6 in step 4 above and it will be ok

Supplementary installation of pip under Windows:

Quick method:

Find the C:\Python27\Scripts directory: Run easy_install.exe pip to install pip

pip upgrade:

When we use pip to install modules, sometimes the pip version is too low

One command solves:

python -m pip install -U pip

Both Linux and Windows support this command

Summarize

The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. If you want to learn more about this, please check out the following links

You may also be interested in:
  • Tutorial on upgrading and installing python 3.8 and configuring pip and yum under Linux
  • Detailed explanation of upgrading Python 2.6 to Python 2.7 on CentOS and installing pip
  • Install, upgrade, and upgrade fixed packages with pip in Python

<<:  MySQL variable declaration and stored procedure analysis

>>:  How to delete table data in MySQL

Recommend

Vue implements dynamic query rule generation component

1. Dynamic query rules The dynamic query rules ar...

MySQL partitions existing tables in the data table

Table of contents How to operate Operation proces...

Introduction to JavaScript built-in objects

Table of contents 1. Built-in objects 2. Math Obj...

Graphical introduction to the difference between := and = in MySQL

The difference between := and = = Only when setti...

Appreciation of the low-key and elegant web design in black, white and gray

Among classic color combinations, probably no one...

Learn the black technology of union all usage in MySQL 5.7 in 5 minutes

Performance of union all in MySQL 5.6 Part 1:MySQ...

CSS 3.0 text hover jump special effects code

Here is a text hovering and jumping effect implem...

How to use boost.python to call c++ dynamic library in linux

Preface Recently I started using robot framework ...

How to use Cron Jobs to execute PHP regularly under Cpanel

Open the cpanel management backend, under the &qu...

Detailed explanation of the benefits of PNG in various network image formats

BMP is an image file format that is independent o...

Detailed explanation of Linux text processing command sort

sort Sort the contents of a text file Usage: sort...

MySQL: Data Integrity

Data integrity is divided into: entity integrity,...