개발_이야기/Docker

error: python3.6 ascii

조규현15 2017. 11. 6. 20:37
반응형


jamo==0.4.0를 설치하는 과정에서 아래 에러 메세지가 발생함.

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe3 in position 701: ordinal not in range(128) 


env에 lang를 utf-8로 세팅해주면 해결됨.


아래는 관련 이슈

 # http://bugs.python.org/issue19846

# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.

ENV LANG C.UTF-8


이걸로 삽질 꽤나 함.


외국인들은 utf가 필요없으니까 안 쓰지만 한국어 관련 python lib를 사용하려면 설정해야 함.


아래는 ubuntu에서 python3.6 설정하는 dockerfile임.

############
# Python 3.6
RUN apt-get update
RUN apt-get install -y software-properties-common vim
RUN add-apt-repository ppa:jonathonf/python-3.6
RUN apt-get update

RUN apt-get install -y build-essential python3.6 python3.6-dev python3-pip python3.6-venv
RUN apt-get install -y git

# update pip
RUN python3.6 -m pip install pip --upgrade
RUN python3.6 -m pip install wheel

ENV LANG C.UTF-8 


반응형