Python 2 is GBK and Python 3 is UTF-8. Some older packages can cause coding problems when installed.
Because PyCharm recently pops up RELP Communications all the time, it affects the efficiency of the code.
REPL (Read-Eval-Print Loop), which translates as “read-evaluation-output” Loop, is a simple, interactive programming environment.
Sounds useful, so I want to PIP the REPL directly in PyCharm.
Error result:
ERROR: Command errored out with exit status 1:
The main error is shown in the last few lines:
UnicodedecodeError: ‘GBK’ codec can’t decode byte 0xa6 in position 1246: illegal multibyte sequence
—————————————-
ror: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Positioning problems:
UnicodeDecodeError, indicating an encoding problem.
Specifically, on lines 10 and 17 of the setup.py file, the read file is encoded as GBK, not UTF-8, so the error prevents installation.
Update the successful solution:
Because you cannot use Project Interpreter in PyCharm.
Solution: download the source code package, make code changes and then install.
1. Locate the file of the original Package and find the line that reported the error.
REPL official address is: https://github.com/mbr/repl. View the source code of the setup file that reported the error.
Location problem: the source code does not specify the open encoding, so the default is GBK encoding.
Error source code:
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
2. After downloading the original package file, unpack it and find the setup.py file. Change this line in the file, add encoding=’utf-8′, save it and package it as a new installation package.
Modified code:
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname),encoding='utf-8').read()
3. Enter PIP install repl-1.0.tar.gz and install with the new package. Success!
This problem bothered me for a week, but it turned out that the solution was very simple!
The most important thing to solve the problem is to locate the cause of the error, and then find a solution step by step according to the reason.
Read More:
- Command errored out with exit status 1: python setup.py egg_info Check the logs for full command ou
- Python installation problem: error: Command erred out with exit status 1:
- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full comm
- Error: command error out with exit status 1: Python setup.py egg_ info Check the ”
- Error: command error out with exit status 1: Python setup.py egg_ inf
- Error: command error out with exit status 1: Python when installing mysqlclient in centos7 setup.py egg_ info Check
- Error: command error out with exit status 1: Python when installing mysqlclient in django2.0 setup.py egg_ info
- To solve Anaconda error: command error out with exit status 1
- Install Python package under MacOS: “error: Command ‘GCC’ failed with exit status 1”
- Python MAC installation mysqlclient package error “error: Command ‘clang’ failed with exit status 1” solution
- Python Mac installs mysqlclient package error “error: command’clang’ failed with exit status 1” solution
- Building wheel for vrep-api-python (setup.py) … error ERROR: Command errored out with exit statu
- command ‘x86_64-linux-gnu-gcc’ failed with exit status 1
- command ‘gcc‘ failed with exit status 4
- Ubuntu16.04 pip3 install PyAudio 出错:error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1
- error: command ‘arm-linux-gnueabihf-gcc’ failed with exit status 1, Raspberry Pi installation paramiko
- Error: Command ‘/ usr / bin / clang’ failed with exit status 1 solution for Mac OS installation
- Error: Command ‘arm linux gnueabihf GCC’ failed with exit status 1, raspberry pie install paramiko
- How does a Mac terminal exit the python command line
- Python program exit: OS_ Exit() and sys.exit ()