Home > Backend Development > Python Tutorial > Installation and use of Python package manager pip

Installation and use of Python package manager pip

高洛峰
Release: 2017-03-23 14:31:55
Original
1590 people have browsed it

Origin

I have been busy doing things for my friends during this period. I have been busy for a long time and I haven’t written a blog for a long time. I made two things, one is an automatic email sending script, and the other is data processing software. Among them, when making data processing software, non-Python system libraries were used, which are two third-party libraries, pandas and numpy. In fact, pandas includes numpy. I didn’t understand it at first, but later I found that after installing numpy from the source code, I installed pandas. I couldn't install it, so I checked it out. Then I uninstalled numpy, then used a Python package manager to manage third-party packages, and downloaded this series of third-party packages. Unfortunately, I just have time now, so I would like to introduce this package manager to you.

pip is currently the most popular Python package management tool. It is used as a replacement for easy_install, but there are still a large number of functions built on setuptools.

Installation

Official website installation introduction: https://pip.pypa.io/en/latest/installing/

The official website introduces it in detail, I will use it here again Install it the old version way~

What I am introducing here is the installation of Python pip under CentOS. In order to maintain the versatility of the platform, I use the source code to install pip.

cd to the directory where you want to download pip, personal suggestion


# cd  /usr/local/src
Copy after login


#wget "https://pypi.python.org/packages/source/p/pip/pip-1.5.4.tar.gz
Copy after login


# tar -xzvf pip-1.5.4.tar.gz
# cd pip-1.5.4# python setup.py install
Copy after login

How do I install it? I am also a person who saves trouble~

Use the following command to install in CentOS


#python -m pip install --upgrade pip
Copy after login

or


#yum install python-pip
Copy after login

It all depends on your preference~

Use

pip to install a third-party package


# pip install SomePackage
Copy after login

column Check out the installed packages


# pip list
Copy after login

View the details of the installed packages


# pip show --files SomePackage
Copy after login

pip upgrade package


# pip install --upgrade SomePackage
Copy after login

pip uninstall package


pip uninstall SomePackage
Copy after login

OK, this is the end of the Python package manager pip. Indeed, it is very short. , but it’s very useful~

The above is the detailed content of Installation and use of Python package manager pip. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template