Turning over the crowds
Brew and pip are two kinds of package management software commonly used on mac, but unfortunately they are all foreign products, so the default source is also foreign, the speed is a lot of wall cards, so it needs to be replaced into a domestic source. Yum is the package management tool of the centos operating system. The default source is also foreign, and the speed is slow.
Brew is a package management tool on mac, similar to apt-get on ubuntu, yum on centos.
The default source speed of brew is too slow, sometimes it will be replaced by a wall…, which can be replaced by the source of China University of Science and Technology.
For bash users:
For zsh users:
Note: It is recommended to replace the above three sources, and then update the brew update.
Pip is python’s package management tool, similar to node.js’ npm management tool.
- pip list # lists all installed libraries
- pip list –outdated # List all expired libraries
- pip install –upgrade library name # update library
- pip install –upgrade pip # update pip itself
- pip freeze # See which packages are installed
- pip install -t /usr/local/lib/python2.7/site-packages/ xlrd # install the library for the specified version of python
- pip install jieba -i https://pypi.douban.com/simple # Single use domestic source installation
The speed of foreign sources is too slow to download in the country, so you need to change the mirror source, you can change it to Alibaba Cloud or Douban.
- Alibaba Cloud http://mirrors.aliyun.com/pypi/simple/
- University of Science and Technology https://pypi.mirrors.ustc.edu.cn/simple/
- Douban http://pypi.douban.com/simple/
- Tsinghua University https://pypi.tuna.tsinghua.edu.cn/simple/
- University of Science and Technology of China http://pypi.mirrors.ustc.edu.cn/simple/
Edit the pip.cofig file, the file location (create one if it doesn’t exist):
- windows:% HOMEPATH% \ pip \ pip.ini
Save and exit.
First back up the /etc/yum.repos.d/CentOS-Base.repo file:
Download the corresponding version of the repo file and put it in /etc/yum.repos.d/, such as Netease Source:
Note: You can also modify the source address in the CentOS-Base.repo file without downloading.
Run the following command to generate the cache: