python-Module Classification and introduction

Source: Internet
Author: User

When using Python, we find that it is often necessary to import some modules. Module is actually a python file, there are three kinds of modules.

one, standard module , also called standard package. This type of module is Python-brought, which can be used directly from the import. such as import String,random,datetime,os,json and so on.

second, third-party module , which is someone else to write some modules, you have to install before you can use. There are 2 methods of installation.

1, the installation of the Fool type.

For example, install the Pymysql module. Direct win key +r, open cmd, enter pip install Pymysql can.

Sometimes there are some problems, the following two kinds of problems often arise:

(1) no PIP command. Resolve it in the following ways.

A, pycharm inside dot python console

B. Find the Python installation directory

C, then put the scripts directory under the installation directory, add to the environment variable inside can

PS: Environment variables are added in path

(2) Unknown or unsupported command ' install ' out of this ask how to solve, can be resolved by the following steps.

A. Open C:\strawberry\perl\bin\

b, the list of the PIP is changed to other names, this has no effect on the other

2. Manual Installation

(1) Install WHL end of installation package

First download the installation package, open cmd in the folder where the WHL file is located, install with PIP install XXXX.WHHL

To open cmd under the specified folder, you can hold down SHIFT + right mouse button and select "Open Command Window Here"

You can also enter CMD in the Address bar of the folder, and then "enter".

(2) Install the. tar.gz end of the installation package

A, decompression of this compression package, after decompression will have a setup.py file;

b, enter the folder after decompression, open the cmd command window;

C. Enter Python setup.py install at command line

Iii. python files written by yourself

python-Module Classification and introduction

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.