1

After a long period where things went OK (I mean here I could pip install packages and then use them in a jupyter notebook with the import statement), I ran into multiple problems recently.

I think this happened when I upgraded my anaconda install from Continuum Analytics (though not sure)

I get error reports for basic imports like pandas or matplotlib like

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-3-adcb0ce40833> in <module>()
      1 # Plot softmax curves
----> 2 import matplotlib.pyplot as plt

/Users/peterhirt/anaconda/envs/tensorflow/lib/python2.7/site-    packages/matplotlib/__init__.py in <module>()
   1129 
   1130 # this is the instance used by the matplotlib classes
-> 1131 rcParams = rc_params()
   1132 
   1133 if rcParams['examples.directory']:

/Users/peterhirt/anaconda/envs/tensorflow/lib/python2.7/site-packages/matplotlib/__init__.py in rc_params(fail_on_error)
    973         return ret
    974 
--> 975     return rc_params_from_file(fname, fail_on_error)
    976 
    977 

/Users/peterhirt/anaconda/envs/tensorflow/lib/python2.7/site-   packages/matplotlib/__init__.py in rc_params_from_file(fname, fail_on_error,     use_default_template)
   1098         parameters specified in the file. (Useful for updating dicts.)
   1099     """
-> 1100     config_from_file = _rc_params_in_file(fname, fail_on_error)
   1101 
   1102     if not use_default_template:

/Users/peterhirt/anaconda/envs/tensorflow/lib/python2.7/site-packages/matplotlib/__init__.py in _rc_params_in_file(fname, fail_on_error)
   1016     cnt = 0
   1017     rc_temp = {}
-> 1018     with _open_file_or_url(fname) as fd:
   1019         try:
   1020             for line in fd:

/Users/peterhirt/anaconda/envs/tensorflow/lib/python2.7/contextlib.pyc in  __enter__(self)
     15     def __enter__(self):
     16         try:
---> 17             return self.gen.next()
     18         except StopIteration:
     19             raise RuntimeError("generator didn't yield")

/Users/peterhirt/anaconda/envs/tensorflow/lib/python2.7/site-    packages/matplotlib/__init__.py in _open_file_or_url(fname)
    998     else:
    999         fname = os.path.expanduser(fname)
-> 1000         encoding = locale.getdefaultlocale()[1]
   1001         if encoding is None:
   1002             encoding = "utf-8"

/Users/peterhirt/anaconda/envs/tensorflow/lib/python2.7/locale.pyc in     getdefaultlocale(envvars)
    541     else:
    542         localename = 'C'
--> 543     return _parse_localename(localename)
    544 
    545 

/Users/peterhirt/anaconda/envs/tensorflow/lib/python2.7/locale.pyc in _parse_localename(localename)
    473     elif code == 'C':
    474         return None, None
--> 475     raise ValueError, 'unknown locale: %s' % localename
    476 
    477 def _build_localename(localetuple):

ValueError: unknown locale: UTF-8

So, I tried to use a specific environment where I installed first the python version I wanted to use and then added things like tensorflow (which went very well)

I do this by

conda create tensorflow python=2.7

this creates me a environment called tensorflow and install python version 2.7

then I activate the envrionment by

source activate tensorflow

Then, I added matplotlib with

pip install matplotlib

and i get again this error

I am lost. I think it has to do with incompatible packages but I cannot go around this and solve it.

Can someone give me a helping hand please

Thanks in advance

Peter

Peter HIRT
  • 741
  • 2
  • 8
  • 18

0 Answers0