From: Karthikesh R. <ka...@ja...> - 2004-05-13 06:19:35
|
Hi, i am trying to get matplotlib working. This seems to be as of now the best that i have found but i cant install it at work. We have a RH9 system, and matplotlib required a lot of development packages and updates. After all the installation (which it says is successful), when i try to import matplotlib or run the examples: (i am using ipython so i can do run xyz.py) > run bar_stacked.py ----> RuntimeError: Could not find the matplotlib data files the path was not working so i manually set the path at the __init__.py file to path = '/home/karthik/usr/share/matplotlib' Then when i try it again > run bar_stacked.py ----> from matplotlib import rcParams ImportError: cannot import name rcParams On the third attempt: > run bar_stacked.py ----> ind = arange(N) NameError: name 'arange' is not defined the numerix package was numarray, and while installation the _image.cpp file had problems with "arrayobject.h", it couldnt find it, i manually set the path as #include "/home/karthik/usr/include/python/numarray/arrayobject.h" How do i proceed now? With warm regards karthik ----------------------------------------------------------------------- Karthikesh Raju, email: ka...@ja... Researcher, http://www.cis.hut.fi/karthik Helsinki University of Technology, Tel: +358-9-451 5389 Laboratory of Comp. & Info. Sc., Fax: +358-9-451 3277 Department of Computer Sc., P.O Box 5400, FIN 02015 HUT, Espoo, FINLAND ----------------------------------------------------------------------- |
From: John H. <jdh...@ac...> - 2004-05-13 11:16:31
|
>>>>> "Karthikesh" == Karthikesh Raju <ka...@ja...> writes: Since you are facing multiple issues, let's try and get the simplest build working and then add stuff in. First though, it would be helpful if you told me what devel rpms you needed to install so I recommend these on the web page to other users. BTW, the two pages most relevant for you with installation information are http://matplotlib.sf.net/installing.html and http://matplotlib.sf.net/backends.html. Make sure you give these a good read. From reading your email, I see that you are installing everything to your home dir, is that right? Step 1: start with a clean matplotlib src tree. I don't want to try and work with the one where you have hardcoded information in the code because then I don't know what is going on. Just untar the tar.gz file in a new dir and start cleanly Step 2: Edit setup.py and turn all the BUILD flags off, except for BUILD_FT2FONT. Let's try and get a working base install and then deal with getting the extension code compiled. Step 3: Edit setupext.py and add any non-standard base dirs in which you have installed stuff (eg /home/you/usr, /home/you/usr/local') to the basedirs dictionary at the top of that file. Your platform is linux2. Step 4: Install matplotlib with > python setup.py install Step 5: If the build doesn't finish cleanly (the only reason I can think it would fail is if you don't get ft2font built properly. This package requires lib freetype so make you have the freetype and freetype-devel libs installed. It also requires libz so make sure you have zlib and zlib-devel installed. If you have installed these to a nonstandard place, make sure you add the basedir to setupext basedirs. Step 6: OK, I'm assuming you have a clean install at this point. If you installed with a non-standard prefix, you need to set your MATPLOTLIBDATA environment variable. This data should point to the dir that contains, for example, all the Vera*.ttf files. Eg, /your/install/prefix/share/matplotlib. If you add this to your rc file, make sure you resource your rc or open a new shell. Step 7: At this point, if you have numarray and pygtk installed (1.99.16 or later), you should be able to import matplotlib. Open up python shell and make sure you can do >>> import pygtk >>> pygtk.require('2.0') >>> import gtk >>> import numarray >>> import matplotlib If not, let us know what error you are getting. You should now be able to run python simple_plot.py -dGTK Step 8: Edit setup.py and add the other build flags back in. You can set the ones you want to build to 'auto', which will try and build an extension if the python dependencies are found. If you still have problems with arrayobject.h, let me know. You can add the include path to that file in the build_image method in setupext.py by doing module.include_dirs.append('/your/path/to/numerix/headers') ie, /home/karthik/usr/include/python/numarray We do want to improve the build process for people who have stuff in non-default locations, and it would be very helpful for us if you tell us explicitly what you had to add and change in the steps above so we can incorporate as much as possible into the default. Good luck! JDH |
From: Karthikesh R. <ka...@ja...> - 2004-05-13 12:48:25
|
Hi John, Thankx for your reply. Well, i have tried the following: step 1: done step 2: done step 3: i have added '/home/karthik/usr' to the basedir which is now basedir = { 'win32' : bla bla 'linux2': ['/usr','/home/karthik/usr','/home/karthik/usr/include'] } Now when i try installing matplotlib, i just get : gcc -DNDEBUG -O2 -g -pipe -march=i386 -mcpu=i686 -D_GNU_SOURCE -fPIC -fPIC -I/usr/include -I/home/karthik/usr/include -I/home/karthik/usr/include/python/numarray/include -Isrc -Iagg2/include -I/usr/include/python2.2 -c src/_image.cpp -o build/temp.linux-i686-2.2/_image.o -DNUMARRAY src/_image.cpp:8:35: numarray/arrayobject.h: No such file or directory src/_image.cpp: In function `PyObject* _image_fromarray(PyObject*, PyObject*)': src/_image.cpp:555: `PyArrayObject' undeclared (first use this function) src/_image.cpp:555: (Each undeclared identifier is reported only once for each function it appears in.) src/_image.cpp:555: `A' undeclared (first use this function) src/_image.cpp:561: parse error before `)' token src/_image.cpp: In function `void init_image()': src/_image.cpp:671: `import_array' undeclared (first use this function) error: command 'gcc' failed with exit status 1 Ofcourse, numarray/arrayobject.h is at /home/karthik/usr/include/python/numarray What should i do next ? With warm regards karthik PS: the array image was numeric ----------------------------------------------------------------------- Karthikesh Raju, email: ka...@ja... Researcher, http://www.cis.hut.fi/karthik Helsinki University of Technology, Tel: +358-9-451 5389 Laboratory of Comp. & Info. Sc., Fax: +358-9-451 3277 Department of Computer Sc., P.O Box 5400, FIN 02015 HUT, Espoo, FINLAND ----------------------------------------------------------------------- On Thu, 13 May 2004, John Hunter wrote: > >>>>> "Karthikesh" == Karthikesh Raju <ka...@ja...> writes: > > Since you are facing multiple issues, let's try and get the simplest > build working and then add stuff in. First though, it would be > helpful if you told me what devel rpms you needed to install so I > recommend these on the web page to other users. BTW, the two pages > most relevant for you with installation information are > http://matplotlib.sf.net/installing.html and > http://matplotlib.sf.net/backends.html. Make sure you give these a > good read. > > From reading your email, I see that you are installing everything to > your home dir, is that right? > > Step 1: start with a clean matplotlib src tree. I don't want to try > and work with the one where you have hardcoded information in the > code because then I don't know what is going on. Just untar the > tar.gz file in a new dir and start cleanly > > Step 2: Edit setup.py and turn all the BUILD flags off, except for > BUILD_FT2FONT. Let's try and get a working base install and then deal > with getting the extension code compiled. > > Step 3: Edit setupext.py and add any non-standard base dirs in which > you have installed stuff (eg /home/you/usr, /home/you/usr/local') to > the basedirs dictionary at the top of that file. Your platform is > linux2. > > Step 4: Install matplotlib with > python setup.py install > > Step 5: If the build doesn't finish cleanly (the only reason I can > think it would fail is if you don't get ft2font built properly. > This package requires lib freetype so make you have the freetype and > freetype-devel libs installed. It also requires libz so make sure > you have zlib and zlib-devel installed. If you have installed these > to a nonstandard place, make sure you add the basedir to setupext > basedirs. > > Step 6: OK, I'm assuming you have a clean install at this point. If > you installed with a non-standard prefix, you need to set your > MATPLOTLIBDATA environment variable. This data should point to the > dir that contains, for example, all the Vera*.ttf files. Eg, > /your/install/prefix/share/matplotlib. If you add this to your rc > file, make sure you resource your rc or open a new shell. > > Step 7: At this point, if you have numarray and pygtk installed > (1.99.16 or later), you should be able to import matplotlib. Open up > python shell and make sure you can do > > >>> import pygtk > >>> pygtk.require('2.0') > >>> import gtk > >>> import numarray > >>> import matplotlib > > If not, let us know what error you are getting. You should now be > able to run python simple_plot.py -dGTK > > > Step 8: Edit setup.py and add the other build flags back in. You can > set the ones you want to build to 'auto', which will try and build > an extension if the python dependencies are found. If you still > have problems with arrayobject.h, let me know. You can add the > include path to that file in the build_image method in setupext.py > by doing > > module.include_dirs.append('/your/path/to/numerix/headers') > > ie, /home/karthik/usr/include/python/numarray > > > We do want to improve the build process for people who have stuff in > non-default locations, and it would be very helpful for us if you tell > us explicitly what you had to add and change in the steps above so we > can incorporate as much as possible into the default. > > Good luck! > JDH > > |
From: John H. <jdh...@ac...> - 2004-05-13 13:15:14
|
>>>>> "Karthikesh" == Karthikesh Raju <ka...@ja...> writes: Karthikesh> Ofcourse, numarray/arrayobject.h is at Karthikesh> /home/karthik/usr/include/python/numarray Karthikesh> What should i do next ? Well it looks like you did not turn off the BUILD_IMAGE flag - set BUILD_IMAGE = 0 and all the other BUILD_* flags except FT2FONT to 0. The instructions for how to handle arrayobject are included later in my instructions, but let's stay on target! Note that I did give you the wrong path for arrayobject in my previous email. When you get to step 8, I'm fairly certain you will need module.include_dirs.append('/home/karthik/usr/include/python') JDH |
From: Karthikesh R. <ka...@ja...> - 2004-05-13 13:34:09
|
Hi John, Looks like in the previous mail, i had set the build numarray on, now i removed that flag, and the installation went on smooth, and i could 1) pygtk, 2) gtk, and 3) matplotlib things went smooth so far, and i run most of the examples bearing some. Now i will try to set things to auto slowly and try the rest. BTW: the following were the developmental packages that i needed here: (At work our sys's have not installed any of the developmental packages) audiofile-devel-0.2.3-6.i386.rpm gtk2-devel-2.2.1-4.i386.rpm esound-devel-0.2.28-4.i386.rpm gtk+-devel-1.2.10-25.i386.rpm freetype-2.1.3-6.i386.rpm imlib-devel-1.9.13-12.i386.rpm freetype-devel-2.1.3-6.i386.rpm ORBit-devel-0.5.17-7.i386.rpm freetype-utils-2.1.3-6.i386.rpm pygtk2-1.99.16-8rh9.i386.rpm glib-devel-1.2.10-10.i386.rpm pygtk2-devel-1.99.16-8rh9.i386.rpm gnome-libs-devel-1.4.1.2.90-32.i386.rpm pygtk2-libglade-1.99.16-8rh9.i386.rpm Many had circular dependences, and hence the requirement. Thankx, warm regards karthik ----------------------------------------------------------------------- Karthikesh Raju, email: ka...@ja... Researcher, http://www.cis.hut.fi/karthik Helsinki University of Technology, Tel: +358-9-451 5389 Laboratory of Comp. & Info. Sc., Fax: +358-9-451 3277 Department of Computer Sc., P.O Box 5400, FIN 02015 HUT, Espoo, FINLAND ----------------------------------------------------------------------- On Thu, 13 May 2004, John Hunter wrote: > >>>>> "Karthikesh" == Karthikesh Raju <ka...@ja...> writes: > > Since you are facing multiple issues, let's try and get the simplest > build working and then add stuff in. First though, it would be > helpful if you told me what devel rpms you needed to install so I > recommend these on the web page to other users. BTW, the two pages > most relevant for you with installation information are > http://matplotlib.sf.net/installing.html and > http://matplotlib.sf.net/backends.html. Make sure you give these a > good read. > > From reading your email, I see that you are installing everything to > your home dir, is that right? > > Step 1: start with a clean matplotlib src tree. I don't want to try > and work with the one where you have hardcoded information in the > code because then I don't know what is going on. Just untar the > tar.gz file in a new dir and start cleanly > > Step 2: Edit setup.py and turn all the BUILD flags off, except for > BUILD_FT2FONT. Let's try and get a working base install and then deal > with getting the extension code compiled. > > Step 3: Edit setupext.py and add any non-standard base dirs in which > you have installed stuff (eg /home/you/usr, /home/you/usr/local') to > the basedirs dictionary at the top of that file. Your platform is > linux2. > > Step 4: Install matplotlib with > python setup.py install > > Step 5: If the build doesn't finish cleanly (the only reason I can > think it would fail is if you don't get ft2font built properly. > This package requires lib freetype so make you have the freetype and > freetype-devel libs installed. It also requires libz so make sure > you have zlib and zlib-devel installed. If you have installed these > to a nonstandard place, make sure you add the basedir to setupext > basedirs. > > Step 6: OK, I'm assuming you have a clean install at this point. If > you installed with a non-standard prefix, you need to set your > MATPLOTLIBDATA environment variable. This data should point to the > dir that contains, for example, all the Vera*.ttf files. Eg, > /your/install/prefix/share/matplotlib. If you add this to your rc > file, make sure you resource your rc or open a new shell. > > Step 7: At this point, if you have numarray and pygtk installed > (1.99.16 or later), you should be able to import matplotlib. Open up > python shell and make sure you can do > > >>> import pygtk > >>> pygtk.require('2.0') > >>> import gtk > >>> import numarray > >>> import matplotlib > > If not, let us know what error you are getting. You should now be > able to run python simple_plot.py -dGTK > > > Step 8: Edit setup.py and add the other build flags back in. You can > set the ones you want to build to 'auto', which will try and build > an extension if the python dependencies are found. If you still > have problems with arrayobject.h, let me know. You can add the > include path to that file in the build_image method in setupext.py > by doing > > module.include_dirs.append('/your/path/to/numerix/headers') > > ie, /home/karthik/usr/include/python/numarray > > > We do want to improve the build process for people who have stuff in > non-default locations, and it would be very helpful for us if you tell > us explicitly what you had to add and change in the steps above so we > can incorporate as much as possible into the default. > > Good luck! > JDH > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: SourceForge.net Broadband > Sign-up now for SourceForge Broadband and get the fastest > 6.0/768 connection for only $19.95/mo for the first 3 months! > http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
From: John H. <jdh...@ac...> - 2004-05-13 13:38:01
|
>>>>> "Karthikesh" == Karthikesh Raju <ka...@ja...> writes: Karthikesh> Hi John, Looks like in the previous mail, i had set Karthikesh> the build numarray on, now i removed that flag, and Karthikesh> the installation went on smooth, and i could Karthikesh> 1) pygtk, 2) gtk, and 3) matplotlib Karthikesh> things went smooth so far, and i run most of the Karthikesh> examples bearing some. Now i will try to set things Karthikesh> to auto slowly and try the rest. Great! Start with agg, then image, then gtkagg, and that may be all you need. Unless you want to use matplotlib interactively from the shell, in which case tkagg is your best bet. Karthikesh> BTW: the following were the developmental packages Karthikesh> that i needed here: (At work our sys's have not Karthikesh> installed any of the developmental packages) Thanks for the list! I'll put it on the web site. JDH |
From: Karthikesh R. <ka...@ja...> - 2004-05-14 06:38:20
|
Hi John, thanks, it seems to work now atleast .. warm regards karthik ----------------------------------------------------------------------- Karthikesh Raju, email: ka...@ja... Researcher, http://www.cis.hut.fi/karthik Helsinki University of Technology, Tel: +358-9-451 5389 Laboratory of Comp. & Info. Sc., Fax: +358-9-451 3277 Department of Computer Sc., P.O Box 5400, FIN 02015 HUT, Espoo, FINLAND ----------------------------------------------------------------------- On Thu, 13 May 2004, John Hunter wrote: > >>>>> "Karthikesh" == Karthikesh Raju <ka...@ja...> writes: > > Karthikesh> Hi John, Looks like in the previous mail, i had set > Karthikesh> the build numarray on, now i removed that flag, and > Karthikesh> the installation went on smooth, and i could > > Karthikesh> 1) pygtk, 2) gtk, and 3) matplotlib > > Karthikesh> things went smooth so far, and i run most of the > Karthikesh> examples bearing some. Now i will try to set things > Karthikesh> to auto slowly and try the rest. > > > Great! Start with agg, then image, then gtkagg, and that may be all > you need. Unless you want to use matplotlib interactively from the > shell, in which case tkagg is your best bet. > > Karthikesh> BTW: the following were the developmental packages > Karthikesh> that i needed here: (At work our sys's have not > Karthikesh> installed any of the developmental packages) > > Thanks for the list! I'll put it on the web site. > > JDH > > |