Notices


Reply
Thread Tools
Posts: 26 | Thanked: 3 times | Joined on Jan 2009
#1
Hi everyone, I have ipython,scipy,numpy and matplotlib install on my n900, but I cannot plot with matplotlib...please help to see what's wrong, thank you
[1|user@Nokia-N900|~]ipython -pylab
Traceback (most recent call last):
File "/usr/bin/ipython", line 28, in <module>
IPython.Shell.start().mainloop()
File "/usr/lib/pymodules/python2.5/IPython/Shell.py", line 1240, in start
shell = _select_shell(sys.argv)
File "/usr/lib/pymodules/python2.5/IPython/Shell.py", line 1197, in _select_shell
import matplotlib
File "/usr/lib/python2.5/site-packages/matplotlib/__init__.py", line 739, in <module>
rcParams = rc_params()
File "/usr/lib/python2.5/site-packages/matplotlib/__init__.py", line 657, in rc_params
fname = matplotlib_fname()
File "/usr/lib/python2.5/site-packages/matplotlib/__init__.py", line 599, in matplotlib_fname
path = get_data_path() # guaranteed to exist or raise
File "/usr/lib/python2.5/site-packages/matplotlib/__init__.py", line 248, in wrapper
ret = func(*args, **kwargs)
File "/usr/lib/python2.5/site-packages/matplotlib/__init__.py", line 520, in _get_data_path_cached
defaultParams['datapath'][0] = _get_data_path()
File "/usr/lib/python2.5/site-packages/matplotlib/__init__.py", line 516, in _get_data_path
raise RuntimeError('Could not find the matplotlib data files')
RuntimeError: Could not find the matplotlib data files
[1|user@Nokia-N900|~]sudo apt-get install matplotlib-data
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package matplotlib-data
[1|user@Nokia-N900|~]sudo apt-get install python-matplotlib-data python-matplotlib
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-matplotlib-data is already the newest version.
python-matplotlib is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
 
Posts: 26 | Thanked: 3 times | Joined on Jan 2009
#2
In [1]: from pylab import *
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)

/home/developer/<ipython console> in <module>()

/usr/lib/python2.5/site-packages/pylab.py in <module>()
----> 1 from matplotlib.pylab import *
2 import matplotlib.pylab
3 __doc__ = matplotlib.pylab.__doc__

/usr/lib/python2.5/site-packages/matplotlib/__init__.pyc in <module>()
737
738 # this is the instance used by the matplotlib classes
--> 739 rcParams = rc_params()
740
741 rcParamsDefault = RcParams([ (key, default) for key, (default, converter) in \

/usr/lib/python2.5/site-packages/matplotlib/__init__.pyc in rc_params(fail_on_error)
655 'Return the default params updated from the values in the rc file'
656
--> 657 fname = matplotlib_fname()
658 if not os.path.exists(fname):
659 # this should never happen, default in mpl-data should always be found

/usr/lib/python2.5/site-packages/matplotlib/__init__.pyc in matplotlib_fname()
597
598
--> 599 path = get_data_path() # guaranteed to exist or raise
600 fname = os.path.join(path, 'matplotlibrc')
601 if not os.path.exists(fname):

/usr/lib/python2.5/site-packages/matplotlib/__init__.pyc in wrapper(*args, **kwargs)
246 assert callable(func)
247 def wrapper(*args, **kwargs):
--> 248 ret = func(*args, **kwargs)
249
250 if (always or not wrapper._spoke):

/usr/lib/python2.5/site-packages/matplotlib/__init__.pyc in _get_data_path_cached()
518 def _get_data_path_cached():
519 if defaultParams['datapath'][0] is None:
--> 520 defaultParams['datapath'][0] = _get_data_path()
521 return defaultParams['datapath'][0]
522

/usr/lib/python2.5/site-packages/matplotlib/__init__.pyc in _get_data_path()
514 return path
515
--> 516 raise RuntimeError('Could not find the matplotlib data files')
517
518 def _get_data_path_cached():

RuntimeError: Could not find the matplotlib data files
 
Posts: 26 | Thanked: 3 times | Joined on Jan 2009
#3
it seems matplotlib data path cannot be found by ipython?
 
Posts: 26 | Thanked: 3 times | Joined on Jan 2009
#4
after setting the MATPLOTLIBDATA to /usr/share/matplotlib/mpl-data, the problem is gone
 

The Following User Says Thank You to leohart For This Useful Post:
Posts: 26 | Thanked: 3 times | Joined on Jan 2009
#5
also touch matplotlibrc under the dir with backend :GTKAgg to set the correct backend
 
x61's Avatar
Posts: 932 | Thanked: 278 times | Joined on Sep 2009 @ Kentucky
#6
Originally Posted by leohart View Post
also touch matplotlibrc under the dir with backend :GTKAgg to set the correct backend
I am having the same problem. Could you explain how to do this?

Thanks
 
Posts: 13 | Thanked: 20 times | Joined on Feb 2010 @ Chambana
#7
I also ran into this. Edit the file /usr/lib/python2.5/site-packages/matplotlib/mpl-data/matplotlibrc (you will have to create the mpl-data dir most likely) to read:

datapath : /usr/share/matplotlib/mpl-data


I also set the datapath and backend in my user directory

Nokia-N900:~# cat /home/user/.matplotlib/matplotlibrc
datapath : /usr/share/matplotlib/mpl-data
backend : GTKAgg
 

The Following 3 Users Say Thank You to mtrower2 For This Useful Post:
Posts: 13 | Thanked: 3 times | Joined on May 2010 @ Russian working in Poland for an US company :)
#8
matplotlib only worked for me after I created ~/.matplotlib/matplotlibrc (with datapath and backend as previous poster described), creating matplotlibrc in /usr/lib/python2.5/site-packages/matplotlib/mpl-data/ did nothing.

Thank you guys for making matplotlib work for me!
 

The Following User Says Thank You to RCL For This Useful Post:
Posts: 3,328 | Thanked: 4,476 times | Joined on May 2011 @ Poland
#9
What's interesting, setting datapath in /etc/matplotlibrc changes nothing... Any ideas why?

/edit: even if the file in ~ is tweaked, the problem persists if matplotlib is used by an app.
__________________
If you want to support my work, you can donate by PayPal or Flattr

Projects no longer actively developed: here

Last edited by marmistrz; 2014-09-17 at 17:38.
 
Reply

Tags
[solved], _in title bro

Thread Tools

 
Forum Jump


All times are GMT. The time now is 11:11.