[python] Error when installing library ramkan

ramkan is a library for Romaji/Kana conversion. A memorandum because an error occurred during installation.

error contents

ramkan installation

$ pip3 install romkan

Then such an error occurs.

Collecting romkan==0.2.1
  Downloading romkan-0.2.1.tar.gz (10 kB)
    ERROR: Command errored out with exit status 1:
     command: /home/scaruadmin/venv/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-8y_m14tz/romkan_f9a5712add8043608044b16dab0fc01c/setup.py'"'"'; __file__='"'"'/tmp/pip-install-8y_m14tz/romkan_f9a5712add8043608044b16dab0fc01c/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-xw46by6f
         cwd: /tmp/pip-install-8y_m14tz/romkan_f9a5712add8043608044b16dab0fc01c/
    Complete output (7 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-8y_m14tz/romkan_f9a5712add8043608044b16dab0fc01c/setup.py", line 12, in <module>
        README = open(os.path.join(here, 'README.rst')).read()
      File "/opt/rh/rh-python36/root/usr/lib64/python3.6/encodings/ascii.py", line 26, in decode
        return codecs.ascii_decode(input, self.errors)[0]
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xe3 in position 181: ordinal not in range(128)
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

solution

The language setting of python seems to be a problem.

$ sudo vim ~/.bashrc

Add ↓ to the file and save.

export LC_ALL=en_US.UTF-8

restart bash

$source ~/.bashrc

The end

reference

How to deal with UnicodeDecodeError in Python-Introduction to Python

Prerequisite knowledge, etc. Summary of .bash_profile and .bashrc --Qiita Frequently used Vim command summary --Qiita

Postscript

If you are using Docker, you may want to set the language to docker instead of bash. Docker: I want to set the locale of the container --Qiita

Recommended Posts

[python] Error when installing library ramkan
Error when installing a module with Python pip
Error handling when installing mecab-python
Error when playing with python
polyfit error when installing matplotlib
Error when building mac python environment
Support when installing pillow on python3.9
Installing Python 3.4.3.
Error and solution when installing python3 with homebrew on mac (catalina 10.15)
Error resolution when installing numba on macOS
When Python "Syntax Error: Non-ASCII character ~" appears
Python 3.6 email library
Python ast library
Python Error Handling
Error installing pandas_datareader
Python Library notes
Error when trying to install psycopg2 in Python
Summary of error handling methods when installing TensorFlow (2)
What to do if you get an error when installing python with pyenv
What to do if you get an OpenSSL error when installing Python 2 with pyenv
python algorithmic trading library
Python Not Implemented Error
Today's python error: killed
Stumbled when installing PyOCR
Error due to conflict between python when using gurobi
Install python external library
Installing pandas on python2.6
Python error list (Japanese)
Python optimization library Pulp
Error when executing Python commands without using Anaconda Prompt
Precautions when installing fbprophet
When you get an error in python scraping (requests)
[Python] for statement error
Import error resolution record when touching Python code from VSCode
After installing CentOS8 with VirtualBox, an error occurs when restarting
[Python: UnicodeDecodeError] One of the error solutions when reading CSV
List of libraries to install when installing Python using Pyenv
Aim python library master (48) autopep8
Aim python library master (36) json2html
Aim python library master (49) psidialogs
Aim python library master (26) easyxml
Aim python library master (29) table_printer
Python evolutionary computation library Deap
Aim python library master (55) namespaces
Aim python library master (46) browserplus
Python Evolutionary Computation Library Deap (3)
Aim python library master (30) chronyk
Aim python library master (3) workalendar
Aim python library master (42) speedrecorder
Aim python library master (37) slimurl
Recommendation of binpacking library of python
Aim python library master (44) pynetviz
Aim python library master (8) rolex
Story when iterating python tuple
Aim python library master (52) marktime
Aim python library master (7) numparser
Aim python library master (21) hy
Aim python library master (18) requests
Windows10: Install python dlib library
Aim python library master (13) easydev
Aim python library master (20) pyyaml