Trying out a pycon tutorial on machine learning and was installing the required packages. Had some problem and accidentally installed without going into my virtualenv. Tried to uninstall matplotlib, numpy, scipy and more without any success as it gave me very long error message.
However, in python, I cannot import matlibplot as I get the following error:
import matplotlib Traceback (most recent call last): File "", line 1, in File "/Users/zhangsheng/Desktop/PYTHON/scikit/sk/lib/python2.7/site-packages/matplotlib/init.py", line 1131, in rcParams = rc_params() File "/Users/zhangsheng/Desktop/PYTHON/scikit/sk/lib/python2.7/site-packages/matplotlib/init.py", line 975, in rc_params return rc_params_from_file(fname, fail_on_error) File "/Users/zhangsheng/Desktop/PYTHON/scikit/sk/lib/python2.7/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/zhangsheng/Desktop/PYTHON/scikit/sk/lib/python2.7/site-packages/matplotlib/init.py", line 1018, in _rc_params_in_file with _open_file_or_url(fname) as fd: File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py", line 17, in enter return self.gen.next() File "/Users/zhangsheng/Desktop/PYTHON/scikit/sk/lib/python2.7/site-packages/matplotlib/init.py", line 1000, in _open_file_or_url encoding = locale.getdefaultlocale()[1] File "/Users/zhangsheng/Desktop/PYTHON/scikit/sk/lib/python2.7/locale.py", line 543, in getdefaultlocale return _parse_localename(localename) File "/Users/zhangsheng/Desktop/PYTHON/scikit/sk/lib/python2.7/locale.py", line 475, in _parse_localename raise ValueError, 'unknown locale: %s' % localename ValueError: unknown locale: UTF-8
I'm quite new to stuff like this and really need help for my problem here. Many thanks :)
I'm on a mac and I used pip to install these packages
pip install matplotlib
then uninstalling by using
pip uninstall matplotlib
Initially when i was installing in the a virtualenv I encountered a problem in installing seaborn
after installing matplotlib
, scipy
, numpy
, scikit-learn
, ipython
. So I uninstalled matplotlib
and then installed seaborn
before reinstalling matplotlib
Edit:
As I tried to uninstall those packages mentioned above, I realised that I can import matplotlib
in my python without virtual env. However, if I was to create a virtual env using virtualenv
and install matplotlib
, it can't be imported in the virtual enviroment. Does anyone have a solution to my problem?