[PYTHON] UnicodeEncodeError when trying to run radon

Environmental information

python 3.5.1 OS version 4.4.41-36.55.amzn1.x86_64 (Amazon Linux AMI release 2016.09)

Status

It's fine until I pip install triumphantly to measure complexity using radon, but when I run it with the radon command, I get a Unicode error. When you get a Unicode error, you think you're out.

ERROR: 'ascii' codec can't decode byte 0xe5 in position 47: ordinal not in range(128)

The program that caused the error can be executed independently, and in the first place, only the comment out part is available in Japanese.

When I check pypi, it says to set environment variables. https://pypi.python.org/pypi/radon

Note about file encoding

On some systems, such as Windows, the default encoding is not UTF-8. If you are using Unicode characters in your Python file and want to analyze it with Radon, you’ll have to set the RADONFILESENCODING environment variable to UTF-8.

It's not Windows, but I'll set it up as a trial.

Environment variable settings

Confirm that the environment variable "RADONFILESEN CODING" itself does not exist.

export -p

Added the environment variable "RADONFILESEN CODING".

declare -x RADONFILESENCODING="UTF-8"

reconfirmation

Execute the radon command again

manage.py
    F 36:0 main - A (2)

I passed. It was written as windows, so it was through.

Recommended Posts

UnicodeEncodeError when trying to run radon
Error when trying to install psycopg2 in Python
I got an error when trying to run Hello World in Go language
Settings when you want to run python-mecab with travis
[python] A note when trying to use numpy with Cython
I get [Error 2055] when trying to connect to MySQL on Heroku
I noticed while trying to run ninix-aya with Docker (Part 3)
Stumble when trying to share clipboard between VirtualBox and Mac
Ubuntu 20.04 does not start when trying to install nvidia driver
Precautions when upgrading TensorFlow (to 1.3)
To run gym_torcs with ubutnu16
How to run Notepad ++ Python
fd_set in select (2) drops when trying to set fd greater than 1024
Freetype2 support not available on PIL when trying to blockdiag on CentOS6.5
A story about trying to automate a chot when cooking for yourself
I get an error when trying to install maec 4.0.1.0 with pip
I want to run the Python GUI when starting Raspberry Pi
A story about trying to run multiple python versions (Mac edition)