Many beginners do not have the knowledge, how to import Python libraries and library-related instruction

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/wcg541/article/details/100587360

In the first stage of learning Python, a lot of people do not know if you go to install the module, and if the import module, especially beginners zero-based junior partner even more so, and I see in the study group there are many such cases!

Today'll tell you about how to import the relevant instruction Python modules have module.

Source Installation

We are all in the CMD (command prompt) generally installed inside the third module of Python.

Pip install module (module name)

And we need to know Python modules can be found on GitHub source pypi or above, usually have downloaded a setup.py file, then we want to install is:

python setup.py install

If it is not decompressed file, then you can use pip to install, such as:

Pip install package.zip

Package Manager to install

Python language is with the package manager is done by setuptools, Python has two, one kind of PIP, the other is easy_insall.

Simple operation

Common Problems

The official pypi unstable, if such happens, then we have two options:

  1. The use of source code installation, when it comes to the above is small series.
  2. Manually specify the source, after the pip with -i:

Pypi domestic mirror, there are many, such as:

  • Watercress
  • Ali Cloud
  • China University of Science and Technology
  • Tsinghua University
  • Huazhong University of Science
  • Shandong University of Technology

Specifically we are looking for Baidu.

Many times when we install the module, there will be an error, such as:

error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat)

There are times when you will be prompted to install the module's pip, setuptools version is not the same, need to upgrade to the latest version will also give you tips.

If you are still confused in the programming world, you can join us to learn Python buckle qun: 784758214, look at how seniors are learning. Exchange of experience. From basic web development python script to, reptiles, django, data mining and other projects to combat zero-based data are finishing. Given to every little python partner! Share some learning methods and need to pay attention to small details, click on Join us python learner gathering

In fact, these problems are particularly simple, even if you look at Baidu will be able to know the answer, but now more and more of a novice in the learning process, preferring to ask a very simple question in the group which can be asked Baidu ready answer how of how, if the group does not answer to the people inside him, but will also Tucao this group, if someone answered him, just to answer half of it, will be the questioner Tucao, I hope you do not reach out after the party.

After all, other people to help you is mutual affection, not a duty to help you! Cherish what you have at the moment

Guess you like

Origin blog.csdn.net/wcg541/article/details/100587360