X Tutup
Skip to content

UTF-8 error on import of matplotlib 1.5.1 #7879

@EdoVarg

Description

@EdoVarg

To help us understand and resolve your issue, please fill out the form to the best of your ability. You can feel free to delete the sections that do not apply.

Bug report

Bug summary

  • A short 1-2 sentences that succinctly describes the bug

I receive a UTF-8 error when importing matplotlib == 1.5.1 when installed either from conda or pip. I am using OSX 10.11.6 and Python 3.5.2. This laptop has Spanish locale support but this was done entirely within the US locale setting. There is no matplotlibrc file that I am aware of.

Code for reproduction

$ conda install matplotlib
$ python
> import matplotlib
  • A minimum code snippet required to reproduce the bug, also minimizing the number of dependencies required
$ conda install matplotlib
$ python
> import matplotlib# Paste your code here

Actual outcome

  • The output produced by the above code, which may be a screenshot, console output, etc.
$ python
Python 3.5.2 |Continuum Analytics, Inc.| (default, Jul  2 2016, 17:52:12) 
[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "//anaconda/envs/qiime2/lib/python3.5/site-packages/matplotlib/__init__.py", line 1131, in <module>
    rcParams = rc_params()
  File "//anaconda/envs/qiime2/lib/python3.5/site-packages/matplotlib/__init__.py", line 975, in rc_params
    return rc_params_from_file(fname, fail_on_error)
  File "//anaconda/envs/qiime2/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 "//anaconda/envs/qiime2/lib/python3.5/site-packages/matplotlib/__init__.py", line 1018, in _rc_params_in_file
    with _open_file_or_url(fname) as fd:
  File "//anaconda/envs/qiime2/lib/python3.5/contextlib.py", line 59, in __enter__
    return next(self.gen)
  File "//anaconda/envs/qiime2/lib/python3.5/site-packages/matplotlib/__init__.py", line 1000, in _open_file_or_url
    encoding = locale.getdefaultlocale()[1]
  File "//anaconda/envs/qiime2/lib/python3.5/locale.py", line 558, in getdefaultlocale
    return _parse_localename(localename)
  File "//anaconda/envs/qiime2/lib/python3.5/locale.py", line 486, in _parse_localename
    raise ValueError('unknown locale: %s' % localename)
ValueError: unknown locale: UTF-8

Expected outcome

  • A description of the expected outcome from the code snippet

A successful import of matplotlib

  • If this used to work in an earlier version of Matplotlib, please note the version it used to work on

Matplotlib version

1.5.1

  • Matplotlib version, Python version and Platform (Windows, OSX, Linux ...)

Please see above

  • How did you install Matplotlib and Python (pip, anaconda, from source ...)

Tried conda and pip.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup