Ubuntu configuration pip domestic image source accelerated installation

Source: Internet
Author: User
Tags install django pip install django
Problem description The domestic mirror source list permanently replaces the PIP image source 1. Create the pip.conf file 2. Edit pip.conf File 3. Test speed temporarily displace mirror source Problem Description

based on the problem of domestic speed, our direct PIP installation package is usually very slow, and often appear to half of the failure of the problem, in this way, we must make full use of the power of the domestic mirror, save time, significantly improve the efficiency of PIP installation. Here are my actions to share, There are two methods of permanent replacement and temporary replacement. list of domestic mirror sources

watercress (Douban) http://pypi.douban.com/simple/(recommended)
Tsinghua University https://pypi.tuna.tsinghua.edu.cn/simple/
Alibaba Cloud http://mirrors.aliyun.com/pypi/simple/
China University of Science and Technology https://pypi.mirrors.ustc.edu.cn/simple/
China University of Science and Technology http://pypi.mirrors.ustc.edu.cn/simple/
We recommend Watercress/douban Image source, all of the following examples will also take the watercress image source as an example.
permanently displace pip image source 1. Create a pip.conf file

Run the following command:

CD ~/.pip
1

If the prompt directory does not exist, we have to create one on our own, then enter the directory

mkdir ~/.pip
CD ~/.pip
1 2

Create a pip.conf file under the. Pip Directory

Touch pip.conf
1

The file is created (of course, if you already have the file, this step can be skipped). 2. Edit the pip.conf file

sudo gedit ~/.pip/pip.conf
1

Open the Pip.conf File window and copy the following to the file:

[Global]
Index-url = Http://pypi.douban.com/simple
[Install]
Trusted-host=pypi.douban.com

This replaces the success, and of course you can choose a different mirror source. 3. Test speed

Try to install the Django Library, run

Pip Install Django
1

The terminal feedback content is

Collecting Django
Downloading http://pypi.doubanio.com/packages/87/9f/ 4ec8b197d83666fddd2398842024c5341ee7d40bbec6aee9705d1ad22f13/django-2.0.tar.gz (8.0MB)
100% |████████████████████████████████| 8.0MB 4.3mb/s

you can see the download speed is very fast, this is the power of mirroring. temporarily displace a mirror source

Also take the watercress image source as an example, next we install the Pygame package, you can replace the name of the other package you want to install.

Pip Install Pygame-i http://pypi.douban.com/simple
1

If this is an error, change the command to

pip install pygame-i http://pypi.douban.com/simple-- Trusted-host pypi.douban.com 
1

Can also be installed quickly and successfully:

Collecting pygame
Downloading/http pypi.doubanio.com/packages/dc/76/fdfb5cee3432192a89df6aad8a33eed96ba6a3a16e0dca951db9fef03688/ PYGAME-1.9.3-CP27-CP27MU-MANYLINUX1_X86_64.WHL (9.4MB)
100% |████████████████████████████████| 9.4MB 3.8MB/s
Installing collected Packages:pygame
successfully installed pygame-1.9.3

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.