Explore Courses Blog Tutorials Interview Questions
0 votes
in Data Science by (17.6k points)

I am using a Mac OSX Yosemite 10.10.5 and I am trying to practice data science with python on my laptop. I am using python 3.5.1 on a virtualenv however when I install pandas and matplotlib seems like both of them are having a conflict when trying to be imported. Both has same error and the output is:

>>> import matplotlib

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

  File "/Users/deanarmada/.virtualenvs/python3-data-science/lib/python3.5/site-packages/matplotlib/", line 1131, in <module>

    rcParams = rc_params()

  File "/Users/deanarmada/.virtualenvs/python3-data-science/lib/python3.5/site-packages/matplotlib/", line 975, in rc_params

    return rc_params_from_file(fname, fail_on_error)

  File "/Users/deanarmada/.virtualenvs/python3-data-science/lib/python3.5/site-packages/matplotlib/", line 1100, in rc_params_from_file

    config_from_file = _rc_params_in_file(fname, fail_on_error)

  File "/Users/deanarmada/.virtualenvs/python3-data-science/lib/python3.5/site-packages/matplotlib/", line 1018, in _rc_params_in_file

    with _open_file_or_url(fname) as fd:

  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/", line 59, in __enter__

    return next(self.gen)

  File "/Users/deanarmada/.virtualenvs/python3-data-science/lib/python3.5/site-packages/matplotlib/", line 1000, in _open_file_or_url

    encoding = locale.getdefaultlocale()[1]

  File "/Users/deanarmada/.virtualenvs/python3-data-science/lib/python3.5/", line 559, in getdefaultlocale

    return _parse_localename(localename)

  File "/Users/deanarmada/.virtualenvs/python3-data-science/lib/python3.5/", line 487, in _parse_localename

    raise ValueError('unknown locale: %s' % localename)

ValueError: unknown locale: UTF-8

1 Answer

0 votes
by (41.4k points)

Before accessing python through terminal, run this:

export LC_ALL=C

If you wish to Learn Python Pandas visit this Python Course.

Related questions

0 votes
1 answer
0 votes
1 answer
asked Jul 31, 2019 in Data Science by sourav (17.6k points)
0 votes
1 answer
0 votes
1 answer

Browse Categories