FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

import matplotlib causes UnicodeDecodeError · Issue #6387 · matplotlib/matplotlib · GitHub

Repository navigation

import matplotlib causes UnicodeDecodeError #6387

Closed

Description

OS: Debian (neurodebian virtual machine: http://neuro.debian.net/vm.html)
Matplotlib version: 1.5.1, installed with miniconda on python 2.7.11

I created a python environment with matplotlib installed (and a bunch of other stuff). Unfortunately, when trying to import matplotlib, I get the following error:

(/home/brain/sct_3.0_beta8/python)brain@neurodebian:~$ python
Python 2.7.11 |Continuum Analytics, Inc.| (default, Dec  6 2015, 18:08:32) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> import matplotlib
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
UnicodeDecodeError: 'utf8' codec can't decode byte 0xb1 in position 35: invalid start byte

Any idea where this issue come from and how to fix it?
Thanks!

Original issue: spinalcordtoolbox/spinalcordtoolbox#862

Activity

  1. tacaswell commented on May 8, 2016

    Member

    Do you have non-ascii characters in your user path?

    Does this happen with python3?

  2. tacaswell commented on May 8, 2016

    Member

    For reference

    In [18]: chr(0xb1)
    Out[18]: '±'

    What is in your .matlplotlibrc file?

  3. benjamindeleener commented on May 8, 2016

    Author

    I didn't try on Python 3 (I'll try soon) and I don't think I have non-ascii characters in my user path.
    When I type chr(0xb1), I get the following result:

    >>> chr(0xb1)
    '\xb1'

    And actually, it does not look that I have a .matplotlibrc file... (I looked in .config/matplotlib/)

    And it seems matplotlib was not correctly installed. I uninstalled it and reinstalled it and now it works.
    That's weird.

  4. tacaswell commented on May 8, 2016

    Member

    The output of chr is a python 2/3 difference. It looks like 3 correctly handles high-code points where as 2 falls back to str(int()) just displaying the hex for the byte value

  5. efiring commented on Jul 15, 2016

    Member

    I gather the problem has been solved. If not, feel free to reopen this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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


      Back | FazBrowse Home | New Git URL