In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to speed up the installation of Python third-party libraries". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's ideas to study and learn "how to speed up the installation of Python third-party libraries".
Pip is a Python package management tool, which provides the function of finding, downloading, installing and uninstalling Python packages.
In python, use the pip command to install the Python package. The default is to download foreign libraries, which is usually very slow or other errors occur during the download process, resulting in unsuccessful downloads.
In view of the above problems, we can modify the pip command source to point to the domestic mirror source, which can greatly improve the installation efficiency and success rate.
Modify the source method to replace temporarily
You can specify the pip mirror source by adding the-I parameter to the pip command.
The windows system uses cmd quick setup, and the mac system uses terminals.
Take installing pandas as an example:
Pip install pandas-I https://pypi.tuna.tsinghua.edu.cn/simple or
Pip install-I https://pypi.tuna.tsinghua.edu.cn/simple pandas Note: if python3 is used on mac, replace pip with pip3, same below. Permanent replacement
After pip install pip-U # upgrades pip to the latest version of pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple, it can be installed permanently using domestic sources.
Freeze function pip also has a very convenient feature called freeze, which can help you quickly migrate the Python environment from machine A to machine B, avoiding reinstalling each third-party software package on the new machine.
The corresponding commands are as follows:
Generate requirements.txt files in environment A
$pip freeze > requirements.txt Clone Environment An in Environment B
$pip install-r requirements.txt uses requirements to name files, which is a common practice, not mandatory. Above.
Thank you for your reading, the above is the content of "how to speed up the installation of Python third-party libraries". After the study of this article, I believe you have a deeper understanding of how to speed up the installation of Python third-party libraries. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.