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. py
Enter 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.