One, Python package management tools
Python package management tool to easily install third-party modules
1. Setuptools
: https://pypi.python.org/pypi/setuptools/
Setuptools-24.0.3.tar.gz's:
https://pypi.python.org/packages/84/24/610d8bb87219ed6d0928018b7b35ac6f6f6ef27a71ed6a2d0cfb68200f65/ Setuptools-24.0.3.tar.gz
1) Ubuntu Installation: sudo apt-get install Python-setuptools
2) CentOS Installation:
Tar zxvf setuptools-24.0.3.tar.gz
CD setuptools-24.0.3
Python setup.py Build
Python setup.py Install
3) Windows installation: Download ez_setup.py first, command line into its directory, execute
Python setup.py Build
Python setup.py Install
There is no understanding of its usage, and MySQLdb has a dependency on it.
2. PIP (we recommend using the PIP Management Plug-in package)
: https://pypi.python.org/pypi/pip/Download pip-8.1.2.tar.gz
1) Ubuntu Installation: sudo apt-get install Python-pip
2) Windows installation: Download toolkit, command line into its directory,
Note: Windows python2.7 comes with a lower version and will prompt for an upgrade when it is first used.
D:\python27\scripts>pip Install--upgrade pip
You are using the PIP version 7.0.1, however version 8.1.2 is available.
You should consider upgrading via the ' pip install--upgrade pip ' command.
Collecting Pip
Downloading PIP-8.1.2-PY2.PY3-NONE-ANY.WHL (1.2MB)
100% |████████████████████████████████| 1.2MB 48kb/s
Installing collected Packages:pip
Found existing Installation:pip 7.0.1
Uninstalling pip-7.0.1:
Successfully uninstalled pip-7.0.1
Failed to write executable-trying to use. DeleteMe logic
Successfully installed pip-8.1.2
D:\python27\scripts>
3) installation under centos6.x
Tar zxvf pip-8.1.2.tar.gz
CD pip-8.1.2
Python setup.py Build
Python setup.py Install
Examples of Use:
# pip-h
Usage:
Pip <command> [Options]
Commands:
Install install packages.
Download Download packages.
Uninstall Uninstall packages.
Freeze Output installed packages in requirements format.
List List installed packages.
Show show information about installed packages.
Search Search PyPI for packages.
Wheel Build wheels from your requirements.
Hash Compute hashes of the package archives.
Completion A helper command used for command completion
Help Show Help for commands.
Example: Installing a Redis Package
# pip Install Redis
# PIP List
Mysql-python (1.2.3)
Pip (8.1.2)
Redis (2.10.5)
Setuptools (24.0.3)
Second, common third-party Python plug-in installation
1. Installation and use of MYSQLDB
(1) Windows version MYSQLDB installation
Http://www.codegood.com/downloads
Download Mysql-python-1.2.3.win-amd64-py2.7.ext to install directly.
Test the Python test module after installation.
Import MySQLdb
(2) centos6.x installation and installation of MYSQLDB module
Note: You will be prompted to install the Setuptools during the installation of the MySQLdb module, so you need to install Setuptools first
[[email protected] mysql-python-1.2.3]# python setup.py build
Traceback (most recent):
File "setup.py", line 5, <module>
From Setuptools import Setup, Extension
Importerror:no module named Setuptools
Mysql-python-1.2.3.tar.gz's:
Http://jaist.dl.sourceforge.net/project/mysql-python/mysql-python/1.2.3/MySQL-python-1.2.3.tar.gz
or download here:
http://sourceforge.net/projects/mysql-python/
https://pypi.python.org/pypi/MySQL-python/1.2.4
Setuptools-24.0.3.tar.gz's:
https://pypi.python.org/packages/84/24/610d8bb87219ed6d0928018b7b35ac6f6f6ef27a71ed6a2d0cfb68200f65/ Setuptools-24.0.3.tar.gz
The installation process is as follows:
Tar xvf mysql-python-1.2.3.tar.gz
CD mysql-python-1.2.3
Python setup.py Build
Python setup.py Install
(3) PIP mode installation
Installing MYSQLDB with PIP is also a command that requires pre-installation of PIP.
Pip Install Mysql-python
2. Install the Paramiko module under Linux
Paramiko is a module for remote control that can be used to command or file operations on a remote server.
Pycrypto, since the Paramiko module is internally dependent on Pycrypto, download the installation first Pycrypto
# Download Install Pycrypto
wget http://files.cnblogs.com/files/wupeiqi/pycrypto-2.6.1.tar.gz
TAR-XVF pycrypto-2.6.1.tar.gz
CD pycrypto-2.6.1
Python setup.py Build
Python setup.py Install
# Enter the Python environment, import crypto to check if the installation was successful
# Download Install Paramiko
wget http://files.cnblogs.com/files/wupeiqi/paramiko-1.10.1.tar.gz
TAR-XVF paramiko-1.10.1.tar.gz
CD paramiko-1.10.1
Python setup.py Build
Python setup.py Install
# Enter the Python environment, import Paramiko to check if the installation was successful
3. Install the connection cx_oracle Library under Linux for Python connection to Oracle database
Blog Links:
http://koumm.blog.51cto.com/703525/1436501
...
This article is from the "Koumm Linux Technology blog" blog, be sure to keep this source http://koumm.blog.51cto.com/703525/1827361
Python Third Library installation method record