Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the methods of installing packages for Python

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces "what are the methods of installing the Python package". In the daily operation, I believe that many people have doubts about the method of installing the Python package. The editor consulted all kinds of materials and sorted out the simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "what are the methods of installing the Python package?" Next, please follow the editor to study!

1. Use easy_install

Easy_install this is probably the oldest way to install packages, and almost no one uses it now. Here are some examples of easy_install installation

# find the latest version from PyPI by package name Automatically download, compile, install $easy_install pkg_name # find a link from the specified download page through the package name to install or upgrade the package $easy_install-f http://pythonpaste.org/package_index.html # specify the package address online install $easy_install http://example.com/path/to/MyPackage-1.2.3.tgz # install $easy_install xxx.egg from the local .egg file

two。 Use pip install

Pip is the most mainstream package management solution, and using pip install xxx, you can search for and install xxx from PYPI (if the package exists).

Here are only some common installation examples of pip install

$pip install requests # premise you must make sure that you have downloaded the pkg package to the / local/wheels directory $pip install-- no-index-- find-links=/local/wheels pkg # installed package version 2.1.2$ pip install pkg==2.1.2 # installed package must be greater than or equal to 2.1.2$ pip install pkg > = 2.1.2 # installed package must be less than or equal to 2.1.2$ pip install pkg

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report