Python pip install Error: SyntaxError: (unicode error) ‘utf-8’ codec can’t decode byte 0xc6
Solution:
Method 1: delete the UTF-8 code and use ASCII code
to delete all UTF-8 code contents in the script program, that is, delete all Chinese
Method 2: indicate the coding method of the script
in the python script program, actively declare that we use UTF-8 coding method
the method of declaration is as follows. Add the following sentence at the top of the program, especially the second sentence
#!/ usr/bin/python
# -*- coding: UTF-8 -*-
At first # – * – Coding: UTF-8 – * – it still reported an error when running again, and the problem of #coding = GBK was solved perfectly
Method 3: after checking, it is found that there is Chinese in the directory where the project is located, which can be changed to English.
Similar Posts:
- Solutions to Python Chinese annotation errors
- C# call Python error no module named OS [How to Solve]
- Solutions to xadmin’s “apps are’t loaded yet” error
- Python Error: Non-UTF-8 code starting with ‘\xe7’ [How to Solve]
- Solutions to Python Chinese annotation errors
- Python pandas.read_ Oserror: initializing from file failed
- [Solved] SSH Remote execute Python 3 error: Unicode encodeerror: ‘ASCII’ codec
- Python sublime3 [Decode error – output not utf-8] Chinese display problem
- AttributeError: module ‘requests’ has no attribute ‘get’ [How to Solve]
- Data truncation: Data too long for column ‘****’