From: Gerry W. <ge...@uc...> - 2004-04-21 19:47:22
|
I'm trying to run the first example in the tutorial but am running into an import problem: ActivePython 2.3.2 Build 231 (ActiveState Corp.) based on Python 2.3.2 (#1, Nov 6 2003, 09:47:20) [GCC 2.96 20000731 (Red Hat Linux 7.3 2.96-113)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from matplotlib.matlab import * Traceback (most recent call last): File "<stdin>", line 1, in ? File "matplotlib/matlab.py", line 128, in ? from axes import Axes File "matplotlib/axes.py", line 10, in ? from axis import XTick, YTick, XAxis, YAxis File "matplotlib/axis.py", line 22, in ? from font_manager import FontProperties File "matplotlib/font_manager.py", line 38, in ? from matplotlib import ft2font ImportError: cannot import name ft2font I've built and installed the freetype2 library and the matplotlib installation cites: running install_lib copying build/lib.linux-i686-2.3/matplotlib/backends/_tkagg.so -> /d2/gerry/local/ActivePython-2.3/lib/python2.3/site-packages/matplotlib/backends copying build/lib.linux-i686-2.3/matplotlib/backends/_backend_agg.so -> /d2/gerry/local/ActivePython-2.3/lib/python2.3/site-packages/matplotlib/backends copying build/lib.linux-i686-2.3/matplotlib/ft2font.so -> /d2/gerry/local/ActivePython-2.3/lib/python2.3/site-packages/matplotlib copying build/lib.linux-i686-2.3/matplotlib/_image.so -> /d2/gerry/local/ActivePython-2.3/lib/python2.3/site-packages/matplotlib Not sure what's going wrong. Please respond to my email as well since I'm not a subscriber to the email list. Thanks, Gerry Wiener |
From: John H. <jdh...@ac...> - 2004-04-21 20:07:05
|
>>>>> "Gerry" == Gerry Wiener <ge...@uc...> writes: Gerry> I'm trying to run the first example in the tutorial but am Gerry> running into an import problem: Gerry> cannot import name ft2font I haven't seen this one before. Are you using matplotlib-0.53 (released today?) My first guess is you have two python's installed and are installing to one and running the other. I installed and tested the lastest matplotlib on a redhat 7.1 machine so I don't see any problems with your OS. After upgrading to 0.53, you can make sure you are actually using it by mother:~/tmp/matplotlib-0.53/examples> python Python 2.3 (#1, Aug 29 2003, 12:14:15) [GCC 3.2.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. Welcome to rlcompleter2 0.95 for nice experiences hit <tab> multiple times >>> import matplotlib >>> matplotlib.version '0.53' If this doesn't help, let me know what > ldd /d2/gerry/local/ActivePython-2.3/lib/python2.3/site-packages/matplotlib/ft2font.so reveals. John Hunter |
From: Todd M. <jm...@st...> - 2004-04-21 20:35:19
|
Hi Gerry, I just noticed a similar "failure" when I try to run matplotlib from the root of the source tree, i.e. the directory matplotlib-0.53. I think doing that (running from the root) causes Python to interpret the matplotlib subdirectory (matplotlib-0.53/matplotlib) as a package and to look for ft2font.so there rather than in site-packages/matplotlib. Try cd'ing to some other directory. HTH, Todd On Wed, 2004-04-21 at 15:47, Gerry Wiener wrote: > I'm trying to run the first example in the tutorial but am running into > an import problem: > > ActivePython 2.3.2 Build 231 (ActiveState Corp.) based on > Python 2.3.2 (#1, Nov 6 2003, 09:47:20) > [GCC 2.96 20000731 (Red Hat Linux 7.3 2.96-113)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from matplotlib.matlab import * > Traceback (most recent call last): > File "<stdin>", line 1, in ? > File "matplotlib/matlab.py", line 128, in ? > from axes import Axes > File "matplotlib/axes.py", line 10, in ? > from axis import XTick, YTick, XAxis, YAxis > File "matplotlib/axis.py", line 22, in ? > from font_manager import FontProperties > File "matplotlib/font_manager.py", line 38, in ? > from matplotlib import ft2font > ImportError: cannot import name ft2font > > I've built and installed the freetype2 library and the matplotlib > installation cites: > > running install_lib > copying build/lib.linux-i686-2.3/matplotlib/backends/_tkagg.so -> > /d2/gerry/local/ActivePython-2.3/lib/python2.3/site-packages/matplotlib/backends > copying build/lib.linux-i686-2.3/matplotlib/backends/_backend_agg.so -> > /d2/gerry/local/ActivePython-2.3/lib/python2.3/site-packages/matplotlib/backends > copying build/lib.linux-i686-2.3/matplotlib/ft2font.so -> > /d2/gerry/local/ActivePython-2.3/lib/python2.3/site-packages/matplotlib > copying build/lib.linux-i686-2.3/matplotlib/_image.so -> > /d2/gerry/local/ActivePython-2.3/lib/python2.3/site-packages/matplotlib > > Not sure what's going wrong. Please respond to my email as well since > I'm not a subscriber to the email list. > > Thanks, > > Gerry Wiener > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Todd Miller <jm...@st...> |
From: <er...@jo...> - 2004-04-21 21:03:11
|
Hello again, I am trying to output a large number of pictures to files. I don't know the correct usage of figure() in this case, so my program end up devouring memory continuously. I tried to use the clear() method or del, but neither works. Or I didn't use right. Willing to learn from any of you. Eric |
From: John H. <jdh...@ac...> - 2004-04-21 22:01:47
|
>>>>> "Eric" == <er...@jo...> writes: Eric> I am trying to output a large number of pictures to files. I Eric> don't know the correct usage of figure() in this case, so my Eric> program end up devouring memory continuously. I tried to use Eric> the clear() method or del, but neither works. Or I didn't Eric> use right. I just ran this test script on my system: from matplotlib.matlab import * i = 0 while 1: i+=1 print 'Figure', i figure(1) plot([1,2,3]) savefig('somefig') close(1) The critical thing is to call close, otherwise you won't free the resources (figures are managed by a dictionary so there is a reference to them behind the scenes). To be safest, I would just reuse figure(1) each time and issue close(1) at the end of the loop. However, there is a smallish memory leak even when used correctly. On my system I went from about 6% memory usage to 18% in generating 3300 figures. Tracking it down will be a top priority, so I'll hopefully have a fix soon. 99% likelihood it's either in agg or ft2font. How many figures are you generating and what kind of memory loss are you seeing? If you use the idiom above, does the situation improve? JDH |
From: John H. <jdh...@ac...> - 2004-04-21 21:38:52
|
>>>>> "Todd" == Todd Miller <jm...@st...> writes: Todd> Hi Gerry, I just noticed a similar "failure" when I try to Todd> run matplotlib from the root of the source tree, i.e. the Todd> directory matplotlib-0.53. I think doing that (running from Todd> the root) causes Python to interpret the matplotlib Todd> subdirectory (matplotlib-0.53/matplotlib) as a package and Todd> to look for ft2font.so there rather than in Todd> site-packages/matplotlib. Try cd'ing to some other Todd> directory. Oh yes, that is the very likely culprit. It needs to be a FAQ. Good thinking! JDH |
From: Gerry W. <ge...@uc...> - 2004-04-21 21:50:23
|
Hi Todd, I changed the directory from matplotlib-0.53 and the problem with ft2font went away. Thanks, --Gerry Wiener Todd Miller wrote: >Hi Gerry, > >I just noticed a similar "failure" when I try to run matplotlib from the >root of the source tree, i.e. the directory matplotlib-0.53. I think >doing that (running from the root) causes Python to interpret the >matplotlib subdirectory (matplotlib-0.53/matplotlib) as a package and to >look for ft2font.so there rather than in site-packages/matplotlib. Try >cd'ing to some other directory. > >HTH, >Todd > > >On Wed, 2004-04-21 at 15:47, Gerry Wiener wrote: > > >>I'm trying to run the first example in the tutorial but am running into >>an import problem: >> >>ActivePython 2.3.2 Build 231 (ActiveState Corp.) based on >>Python 2.3.2 (#1, Nov 6 2003, 09:47:20) >>[GCC 2.96 20000731 (Red Hat Linux 7.3 2.96-113)] on linux2 >>Type "help", "copyright", "credits" or "license" for more information. >> >>> from matplotlib.matlab import * >>Traceback (most recent call last): >> File "<stdin>", line 1, in ? >> File "matplotlib/matlab.py", line 128, in ? >> from axes import Axes >> File "matplotlib/axes.py", line 10, in ? >> from axis import XTick, YTick, XAxis, YAxis >> File "matplotlib/axis.py", line 22, in ? >> from font_manager import FontProperties >> File "matplotlib/font_manager.py", line 38, in ? >> from matplotlib import ft2font >>ImportError: cannot import name ft2font >> >>I've built and installed the freetype2 library and the matplotlib >>installation cites: >> >>running install_lib >>copying build/lib.linux-i686-2.3/matplotlib/backends/_tkagg.so -> >>/d2/gerry/local/ActivePython-2.3/lib/python2.3/site-packages/matplotlib/backends >>copying build/lib.linux-i686-2.3/matplotlib/backends/_backend_agg.so -> >>/d2/gerry/local/ActivePython-2.3/lib/python2.3/site-packages/matplotlib/backends >>copying build/lib.linux-i686-2.3/matplotlib/ft2font.so -> >>/d2/gerry/local/ActivePython-2.3/lib/python2.3/site-packages/matplotlib >>copying build/lib.linux-i686-2.3/matplotlib/_image.so -> >>/d2/gerry/local/ActivePython-2.3/lib/python2.3/site-packages/matplotlib >> >>Not sure what's going wrong. Please respond to my email as well since >>I'm not a subscriber to the email list. >> >>Thanks, >> >>Gerry Wiener >> >> >>------------------------------------------------------- >>This SF.Net email is sponsored by: IBM Linux Tutorials >>Free Linux tutorial presented by Daniel Robbins, President and CEO of >>GenToo technologies. Learn everything from fundamentals to system >>administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click >>_______________________________________________ >>Matplotlib-users mailing list >>Mat...@li... >>https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> |