Installing python environment on win10 encounters OSError: raw write ()
The previous article mentioned that bug, which is always found to make mistakes in python code, is not really the problem of its own code. It turns out that it is the problem of win10. Windows really needs a lot of patience to develop. If you are interested, you can refer to this: python3 encounters the pit of win10.
This time encountered pip installation package reported OSError, how to deal with it?
Pip install requests
OSError: raw write () returned invalid length 134( should have been between 0 and 92)
In fact, it is also simple, one order is done, watch this:
Chcp 65001
Active code page: 65001
Then the installation will be very smooth and successful!
Pip install requests
Successfully installed certifi-2018.4.16 chardet-3.0.4 idna-2.7 requests-2.19.1 urllib3-1.23
Why?
Because of the coding of the terminal, under the win10 environment, the Terminal terminal code of pycharm is 936, that is, the American code. View the available commands:
Chcp
nine hundred and thirty six
Use chcp 65001, that is, change to utf-8 coding
For details of this bug, please see: https://bugs.python.org/issue32245#msg308012