Python 2.7 Environment Setup

Source: Internet
Author: User

First, install and modify environment variables

The version I installed is PYTHON-2.7.15.AMD64 because the PIP will be installed in the version after 2.7.9. Add the folder where Python executes files to the path path, C:\Python27. Add the path where the pip execution file is located, C:\Python27\Scripts to the path path.

Verify:

>python-2.7.  >pip-9.0. 3 2.7)


Second, modify the PIP source

Default access to foreign sources when installing dependent packages with Pip: https://pypi.python.org/simple/, but often instability and very slow access, it needs to be replaced with a more stable source in the country.

Windows system, the method is to create a PIP directory in the user directory, such as: C:\Users\xx (user name) \pip, new file Pip.ini, the contents are as follows:

[global]index-url = https://pypi.tuna.tsinghua.edu.cn/simple

I use is Tsinghua's PIP source, it is the official website PyPI The Mirror, synchronizes every 5 minutes.

Three, Pip common commands

Install: Pip Install package name

Pip Install XXX.WHL (offline installation)

Uninstall: Pip Uninstall package name

Upgrade: Pip Install--upgrade package name

Iv. references

1. Change PIP source to domestic mirror, significantly increase download speed

2. Python's WHL file installation

Python 2.7 Environment Setup

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.