0
0

More than 5 years have passed since last update.

tensorflowをインストールしたときに引っかかったこと

Posted at

参考にしたもの たすかりました:)

1: https://www.lifewithpython.com/2016/09/python-ValueError-unknown-locale-UTF-8.html
2: pythonによるスクレイピング&機械学習

2の勉強でやっと機械学習のパートに入ったけど、tensorflowのインストールがうまくいかなかった。

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/DEN/pyenv/versions/anaconda3-4.1.1/lib/python3.5/site-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import *
  File "/Users/DEN/pyenv/versions/anaconda3-4.1.1/lib/python3.5/site-packages/tensorflow/python/__init__.py", line 77, in <module>
    from tensorflow.python.estimator import estimator_lib as estimator
  File "/Users/DEN/pyenv/versions/anaconda3-4.1.1/lib/python3.5/site-packages/tensorflow/python/estimator/estimator_lib.py", line 24, in <module>
    from tensorflow.python.estimator.inputs import inputs
  File "/Users/DEN/pyenv/versions/anaconda3-4.1.1/lib/python3.5/site-packages/tensorflow/python/estimator/inputs/inputs.py", line 22, in <module>
    from tensorflow.python.estimator.inputs.numpy_io import numpy_input_fn
  File "/Users/DEN/pyenv/versions/anaconda3-4.1.1/lib/python3.5/site-packages/tensorflow/python/estimator/inputs/numpy_io.py", line 22, in <module>
    from tensorflow.python.estimator.inputs.queues import feeding_functions
  File "/Users/DEN/pyenv/versions/anaconda3-4.1.1/lib/python3.5/site-packages/tensorflow/python/estimator/inputs/queues/feeding_functions.py", line 38, in <module>
    import pandas as pd
  File "/Users/DEN/pyenv/versions/anaconda3-4.1.1/lib/python3.5/site-packages/pandas/__init__.py", line 39, in <module>
    from pandas.core.api import *
  File "/Users/DEN/pyenv/versions/anaconda3-4.1.1/lib/python3.5/site-packages/pandas/core/api.py", line 10, in <module>
    from pandas.core.groupby import Grouper
  File "/Users/DEN/pyenv/versions/anaconda3-4.1.1/lib/python3.5/site-packages/pandas/core/groupby.py", line 18, in <module>
    from pandas.core.frame import DataFrame
  File "/Users/DEN/pyenv/versions/anaconda3-4.1.1/lib/python3.5/site-packages/pandas/core/frame.py", line 39, in <module>
    from pandas.core.series import Series
  File "/Users/DEN/pyenv/versions/anaconda3-4.1.1/lib/python3.5/site-packages/pandas/core/series.py", line 2944, in <module>
    import pandas.tools.plotting as _gfx  # noqa
  File "/Users/DEN/pyenv/versions/anaconda3-4.1.1/lib/python3.5/site-packages/pandas/tools/plotting.py", line 27, in <module>
    import pandas.tseries.converter as conv
  File "/Users/DEN/pyenv/versions/anaconda3-4.1.1/lib/python3.5/site-packages/pandas/tseries/converter.py", line 7, in <module>
    import matplotlib.units as units
  File "/Users/DEN/pyenv/versions/anaconda3-4.1.1/lib/python3.5/site-packages/matplotlib/__init__.py", line 1131, in <module>
    rcParams = rc_params()
  File "/Users/DEN/pyenv/versions/anaconda3-4.1.1/lib/python3.5/site-packages/matplotlib/__init__.py", line 975, in rc_params
    return rc_params_from_file(fname, fail_on_error)
  File "/Users/DEN/pyenv/versions/anaconda3-4.1.1/lib/python3.5/site-packages/matplotlib/__init__.py", line 1100, in rc_params_from_file
    config_from_file = _rc_params_in_file(fname, fail_on_error)
  File "/Users/DEN/pyenv/versions/anaconda3-4.1.1/lib/python3.5/site-packages/matplotlib/__init__.py", line 1018, in _rc_params_in_file
    with _open_file_or_url(fname) as fd:
  File "/Users/DEN/pyenv/versions/anaconda3-4.1.1/lib/python3.5/contextlib.py", line 59, in __enter__
    return next(self.gen)
  File "/Users/DEN/pyenv/versions/anaconda3-4.1.1/lib/python3.5/site-packages/matplotlib/__init__.py", line 1000, in _open_file_or_url
    encoding = locale.getdefaultlocale()[1]
  File "/Users/DEN/pyenv/versions/anaconda3-4.1.1/lib/python3.5/locale.py", line 558, in getdefaultlocale
    return _parse_localename(localename)
  File "/Users/DEN/pyenv/versions/anaconda3-4.1.1/lib/python3.5/locale.py", line 486, in _parse_localename
    raise ValueError('unknown locale: %s' % localename)
ValueError: unknown locale: UTF-8

難しくないエラーなんだろうけど
ValueError: unknown locale: UTF-8
文字コード?環境変数?の問題だったみたい。

参考サイトより以下のコマンドを打つことで解消された。
export LC_ALL=ja_JP.UTF-8

以上。

0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0