Python, Pip, WHL installation and use

Source: Internet
Author: User
Tags install matplotlib

1 Installation of Python

First, download the required Python version from the Python official website www.python.org, which is this:

Http://www.python.org/ftp/python/2.7.6/python-2.7.6.msi

Then, run the downloaded MSI installation package without changing any of the default settings, and simply "Next" to complete the installation:

By default it will be installed in the C:\Python27 directory, but when you open the Command Prompt window with gusto, typing python will get:

' Python ' is not an internal or external command, nor is it a running program or batch file.

This is because Windows will find the Python.exe according to the path set by the environment variable of path, if not found, it will be an error. The workaround is to add the path where the Python.exe resides C:\Python27 to path.

Now, open a new command-line window (be sure to turn off the original command-line window and open a new one) and enter Python:

You see the prompt indicates that we are already in the >>> Python interactive environment, you can enter any Python code, carriage return will immediately get the result of execution. You can now exit() exit the Python interactive environment by entering and returning to the command line window! )。

2 pip installation 1. Download the latest PIP installation file at the following address: Http://pypi.python.org/pypi/pip#downloads
2. After downloading pip-7.1.2.tar.gz (MD5, PGP), unzip to a folder, enter the extract directory with the CMD console, enter the python setup.py install
python setup.py install
Once installed, we enter PIP directly at the command line, which also shows that ' Pip ' is not an internal command or a running program. Because we haven't added environment variables yet. C:\Python27\Scripts 3 pip using Pip is a Python module management software, Common command: PIP upgrades itself:
Pip install--upgrade pip find and install:
Use Search, install these two parameters. Install to User directory: Pip install pkg_name--user View information for a library:
$ pip Show Jinja2
---
Name:jinja2
version:2.7.3
Location:/path/to/virtualenv/lib/python2.7/site-packages
Requires:markupsafe
To view the libraries you have installed:
Pip list gets the expired library:
Pip list--outdated pip List--outdated | grep Jinja2
4. WHL Installation and use

Of course, you can also download the. whl File for installation

Wheel file is essentially a zip or rar, but he is more convenient for Python installation and use. In the previous image we can install wheel using PIP install Wheel.

Prior to installing BeautifulSoup directly using PIP install BeautifulSoup,

After installing wheel, we can use PIP install XXX.WHL to install the. WHL file.

5. You can also download file installation of source type

Execute Python setup.py install before executing this command, the Setuptools

Download the process for installing the WHL file:
1 Download the corresponding documents in this website, not much narration
2 Install the. WHL file, first we use the command prompt under CMD to enter the directory where the. whl file is located. For example, I installed MATPLOTLIB-1.5.1-CP27-NONE-WIN_AMD64.WHL, I put it in the D:\Python27\Scripts directory. The first step is to enter the directory, such as


3 then through the instructions to install, the command is pip install SOME.WHL, I installed here is MATPLOTLIB-1.5.1-CP27-NONE-WIN_AMD64.WHL, so the input is pip install MATPLOTLIB-1.5.1-CP27-NONE-WIN_AMD64.WHL, so you can, as shown. This download speed is slow, it is recommended to stop downloading other things, and so on after this download and then do the other.

Precautions:
1 Download the corresponding version of the file, or it will fail to install
For example: SCIKIT_LEARN?0.19.1?CP27?CP27M?WIN32.WHL
This file cp27, indicating that the corresponding time python2.7;win32 refers to the time when Python is 32-bit
Another example: SCIKIT_LEARN?0.19.1?CP37?CP37M?WIN_AMD64.WHL
The corresponding is python3.7;win_amd64, which means that Python is a 64-bit

2 How to see how many bits of your python it is, very simple, enter Python directly in cmd, see figure:


Where AMD64 indicates that the corresponding Python is 64 bits.

3 about the difference between Pip and PIP3:
In Windows, which version is added to the environment variable, the PIP is later installed in which Site-package.
Linux, is python3.x with PIP3, the default is Pip, used in python2.x.

Python, Pip, WHL installation and use

Related Article

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.