Python's many ways to install modules

Source: Internet
Author: User

1, self-written module, can be directly added to the path.

This makes it possible to call Directly.

import sys

2, Single File module
Copy files directly to $PYTHON_DIR/LIB

3, The Third-party library downloaded on the internet, after the general decompression, find setup.py file
    Execute python setup.py INSTALL

4, egg file
   1) Download ez_setup.py, execute python ez_setup
   2) Easy _install *.egg

5, pip installation method
   pip is a tool that installs Python packages, provides installation packages, lists installed packages, upgrades packages, and features to uninstall Packages.


Pip is a replacement for easy_install, which provides the same functionality for finding packages as easy_install, so that packages that can be installed using Easy_install are the same and can be installed using Pip.


Install PIP
PIP installation can be through the source Package. Easy_install or Scripts.
Here's a look at the various installation methods:
SOURCE Mode:
$ wget https://pypi.python.org/packages/source/p/pip/pip-1.2.1.tar.gz (replace with latest Package)
$ tar xzf pip-1.2.1.tar.gz
$ CD pip-1.2.1.tar.gz
$ python setup.py Install
Easy_install:
$ easy_install pip
get_pip.py script:
$ curl-0 https://raw.github.com/pypa/pip/master/contrib/get-pip.py
$ sudo python get-pip.py
OK, take a look at the use of PIP
Install the Package
$ pip Install Markdown
List the installed packages
$ pip Freeze
Install a specific version number of the package
Specify a version by using = =, >=, <=, <.
$ pip Install ' markdown<2.0 '
$ pip Install ' markdown>2.0,<2.0.3 '
Upgrade Package
Upgrade the package to the current latest version Number. Ability to Use-u Or--upgrade
$ pip install-u Markdown
Uninstalling packages
$ pip Uninstall Markdown
Query Package
Pip Search "Markdown"

6, Special Library Installation (a Scientific Computing Library Enthought Python distribution Installation)
Enthought Python distribution in Ubuntu installed test, should be a Netizen's request, asked how to install the library, from the official site downloaded a file
Epd_free-7.3-2-rh5-x86.sh. The masking file is an SH format file that executes this file with sudo bash epd_free-7.3-2-rh5-x86.sh, which appears to read with very much Permission. Click Enter. Don't keep it straight.
Need to take a look at it once. Finally appears a same different one of its copyright notice, enter "yes", then down is the folder to choose to install, click enter, installed in the current Folder.
So it's ready for Installation.
Enter under current folder
>>> Ipython--pylab
Just come Out.
Python 2.7.3 (default, Apr 20 2012, 22:44:07)
Type "copyright", "credits" or "license" for more Information.
IPython 0.12.1--an Enhanced Interactive Python.
? Introduction and overview of IPython ' s Features.
%quickref, Quick Reference.
help, Python ' s own Help System.
Object? Details about ' object ', use ' object? ' for extra details.
Welcome to pylab, a matplotlib-based Python environment [backend:tkagg].
For more information, type ' help (pylab) '.
This is called Again.

This library because I do not use the work, so there is no need for further Research.


In [1]: from scipy import *
In [2]: A=zeros (1000)
In 3]: a[:100]=1
In [4:b=fft (a)
In [5]: plot (abs (b))


Python's many ways to install modules

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.