Problem description
Use the following docker command to temporarily run the image: (XXX is a python file)
sudo docker run -it --rm -p 8888:8888 xxx
report errors:
SyntaxError: Non-ASCII character '\xe5' in file xxx on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
Cause analysis
Unsupported character sets may be included when packaging docker images.
Solution
In the first line of dockerfile, add:
ENV LANG C.UTF-8
Read More:
- [Solved] MariaDB Add Datas Error: SQL error [1366] [22007]: (cIncorrect string value: ‘\xE5\xBC\xA0\xE4\xB8\x89’ for column
- [Solved] SyntaxError:JSON.parse:unexpected character at line 1 column 1 of the JSON data
- [Solved] Read file XXX /pom.xml Error when Maven is configured in idea
- [Solved] CentOS build a docker error: job for docker.service failed….
- [Solved] Could not resolve placeholder ‘XXX‘ in value “${XXX}“
- Docker Create tomcat Error standard_init_linux.go:211: exec user process caused “no such file or directory”
- [Solved] “Field pet in XXX.HelloController required a bean of type ‘XXX.Pet‘ that could not be found.“
- [Solved] Eslint error: /xxx/components/xxx import should occur after import of /xxx/utils/xxx
- [Solved] Docker Error: got permission denied while trying to connect to the docker daemon socket at…
- Tk.mapper Common mapper Error: Error creating bean with name ‘commonMapper‘ defined in file xxx
- How to Fix ERROR Couldn’t connect to Docker daemon at http+docker://localunixsocket
- launch file Run Error: Resourcenotfound: XXX [How to Solve]
- Error in node when PM2 starts multiple processes in docker
- docker load Error processing tar file(exit status 1): archive/tar: invalid tar header
- [Solved] docker Error: bridge docker0 failed: exchange full
- vue VM682:1 Uncaught SyntaxError: Unexpected token u in JSON at position 0
- Jenkins reported an error when running the docker permission in the shell script
- [Solved] Docker Start Error: iptables failed: iptables –wait -t nat -A DOCKER -p tcp -d 0/0 –dport 10241
- Docker Open Error: Warning: docker.service changed on disk. Run ‘systemctl daemon-reload‘ to reload unit
- [Solved] Android Develop Error: xxx does not have a NavController set on xxx