Solve the Problem of incorrect installation package using pip in python2.7, python2.7pip

Source: Internet
Author: User

Solve the Problem of incorrect installation package using pip in python2.7, python2.7pip

The following error occurs recently when the pip installation package is used.

UnicodeEncodeError: 'ascii 'codec can't encode character U' \ u258f'

After querying the information, it is found that the python package installed by pip loads the user directory, which is exactly Chinese and cannot be encoded by ascii.

Open the corresponding installation directory pathD: \ Python27 \ Lib \ site-packages

Create a fileSitecustomize. pyEnter the following content

# Encoding = utf8import sysreload (sys) sys. setdefaultencoding ('gb2312 ')

Note:It is gb2312. If it is written as UTF-8, the following garbled characters will occur during installation, but it can also be installed successfully. If gbk2312 doesn't work, try to replace it with UTF-8. The environment is different for everyone.

Summary

The above is all about this article. I hope this article will help you in your study or work. If you have any questions, please leave a message.

Related Article

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.