|
From: Mauro C. <mau...@gm...> - 2009-01-21 23:34:29
|
Dear ALL, I received a report of a Mac OS X user who attempted to run my recently released biodiversity mapping software based on MPL/Basemap and wxPython. As I have no access to an Apple Macintosh machine nor have much experience with that OS anyway, I am posting the error report here in the hope some of you nice guys can help. I am also posting the steps the user followed in order to install the software on the Mac OS X. From the error log, it looks that there may be some issue with the version fo MPL he is using (which is the one packaged with Enthought Python). Thanks in advance for any assistance you can provide. With best regards, ======================== Getting the package to work: 1. need networkx download .egg file from here: http://pypi.python.org/pypi/networkx/ install with: easy_install /Users/nick/Desktop/downloads/networkx-0.99-py2.5.egg (get easy_install from here: http://peak.telecommunity.com/DevCenter/EasyInstall#installing-easy-install http://peak.telecommunity.com/DevCenter/EasyInstall#downloading-and-installing-a-package ) 2. need mpl_toolkits.basemap: download source from here: http://sourceforge.net/project/showfiles.php?group_id=80706&package_id=142792/&abmode=1 install instructions: http://matplotlib.sourceforge.net/basemap/doc/html/users/installing.html 2.1 - download & unpack cd /Users/nick/Desktop/downloads/basemap-0.99.3/ cd geos-2.2.3 export GEOS_DIR=/usr/local ./configure --prefix=$GEOS_DIR make sudo make install cd .. python setup.py install in python: mpl_toolkits.basemap import Basemap need matplotlib 0.98 not 0.91 in python: mpl_toolkits.basemap import Basemap need matplotlib 0.98 not 0.91 2.2 - download updated version http://sourceforge.net/project/showfiles.php?group_id=80706 download basemap: http://sourceforge.net/project/showfiles.php?group_id=80706&package_id=142792&release_id=653688 double click: matplotlib-0.98.5.2-py2.5-macosx10.5.mpkg 3. that didn't work, installing WHOLE NEW VERSION of Enthought which has matplotlib 0.98 http://www.enthought.com/products/epddownload.php redo install of basemap: http://matplotlib.sourceforge.net/basemap/doc/html/users/installing.html cd /Users/nick/Desktop/downloads/basemap-0.99.3/ cd geos-2.2.3 export GEOS_DIR=/usr/local ./configure --prefix=$GEOS_DIR make sudo make install cd .. python setup.py install in python: mpl_toolkits.basemap import Basemap invalid syntax from mpl_toolkits.basemap import Basemap this works! test: cd examples python simpletest.py python run_all.py basemap: most things worked, but not all. Neat mapping capability! Probably slow though... ======================== Basically, the most important thing was re-installing the newest version of Enthought, so as to get matplotlib 0.98, and then installing basemap. So I got all of that working, then ran 'python Croizat.py' and got the following error which has me stymied: ========================================== mws2:/bioinformatics/croizat/Croizat nick$ python -V Python 2.5.2 |EPD Py25 4.1.30101| mws2:/bioinformatics/croizat/Croizat nick$ python Croizat.py matplotlib data path /Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/matplotlib-0.98.3.0001-py2.5-macosx-10.3-fat.egg/matplotlib/mpl-data loaded rc file /Users/nick/.matplotlib/matplotlibrc matplotlib version 0.98.3 verbose.level helpful interactive is True units is False platform is darwin numerix numpy 1.1.1 $HOME=/Users/nick CONFIGDIR=/Users/nick/.matplotlib Using fontManager instance from /Users/nick/.matplotlib/fontManager.cache backend TkAgg version 8.4 Traceback (most recent call last): File "Croizat.py", line 71, in <module> Croizat = Application(0) File "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/wxPython-2.8.7.1.0003_s-py2.5-macosx-10.3-fat.egg/wx/_core.py", line 7836, in __init__ self._BootstrapApp() File "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/wxPython-2.8.7.1.0003_s-py2.5-macosx-10.3-fat.egg/wx/_core.py", line 7433, in _BootstrapApp return _core_.PyApp__BootstrapApp(*args, **kwargs) File "Croizat.py", line 62, in OnInit MainWindow = MainForm(None, -1, "") File "/home/maurobio/Projetos/Croizat/source/MainForm.py", line 201, in __init__ File "/home/maurobio/Projetos/Croizat/source/MainForm.py", line 320, in __do_layout File "/home/maurobio/Projetos/Croizat/source/MainForm.py", line 1187, in DrawMap File "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/basemap-0.99.1.0001-py2.5-macosx-10.3-fat.egg/mpl_toolkits/basemap/__init__.py", line 1361, in drawcoastlines self.set_axes_limits(ax=ax) File "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/basemap-0.99.1.0001-py2.5-macosx-10.3-fat.egg/mpl_toolkits/basemap/__init__.py", line 2501, in set_axes_limits figManager.canvas.draw() AttributeError: 'NoneType' object has no attribute 'canvas' ========================================== -- Dr. Mauro J. Cavalcanti Ecoinformatics Studio P.O. Box 46521, CEP 20551-970 Rio de Janeiro, RJ, BRASIL E-mail: mau...@gm... Web: http://studio.infobio.net Linux Registered User #473524 * Ubuntu User #22717 "Life is complex. It consists of real and imaginary parts." |
|
From: Nick M. <ma...@be...> - 2009-01-26 19:18:17
|
Hi Mauro & Lionel,
I tried changing the backend to WX (and WxAgg) via the matplotlibrc
file, but got the same result. Other suggestions welcome!
Nick
WX:
==================
mws2:/bioinformatics/croizat/Croizat nick$ py Croizat.py
matplotlib data path
/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/matplotlib-0.98.3.0001-py2.5-macosx-10.3-fat.egg/matplotlib/mpl-data
loaded rc file /Users/nick/.matplotlib/matplotlibrc
matplotlib version 0.98.3
verbose.level helpful
interactive is True
units is False
platform is darwin
numerix numpy 1.1.1
$HOME=/Users/nick
CONFIGDIR=/Users/nick/.matplotlib
Using fontManager instance from /Users/nick/.matplotlib/fontManager.cache
backend WX version 2.8.7.1
Traceback (most recent call last):
File "Croizat.py", line 71, in <module>
Croizat = Application(0)
File
"/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/wxPython-2.8.7.1.0003_s-py2.5-macosx-10.3-fat.egg/wx/_core.py",
line 7836, in __init__
self._BootstrapApp()
File
"/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/wxPython-2.8.7.1.0003_s-py2.5-macosx-10.3-fat.egg/wx/_core.py",
line 7433, in _BootstrapApp
return _core_.PyApp__BootstrapApp(*args, **kwargs)
File "Croizat.py", line 62, in OnInit
MainWindow = MainForm(None, -1, "")
File "/home/maurobio/Projetos/Croizat/source/MainForm.py", line 201,
in __init__
File "/home/maurobio/Projetos/Croizat/source/MainForm.py", line 320,
in __do_layout
File "/home/maurobio/Projetos/Croizat/source/MainForm.py", line 1187,
in DrawMap
File
"/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/basemap-0.99.1.0001-py2.5-macosx-10.3-fat.egg/mpl_toolkits/basemap/__init__.py",
line 1361, in drawcoastlines
self.set_axes_limits(ax=ax)
File
"/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/basemap-0.99.1.0001-py2.5-macosx-10.3-fat.egg/mpl_toolkits/basemap/__init__.py",
line 2501, in set_axes_limits
figManager.canvas.draw()
AttributeError: 'NoneType' object has no attribute 'canvas'
==================
WxAgg:
===================
mws2:/bioinformatics/croizat/Croizat nick$ py Croizat.py
matplotlib data path
/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/matplotlib-0.98.3.0001-py2.5-macosx-10.3-fat.egg/matplotlib/mpl-data
loaded rc file /Users/nick/.matplotlib/matplotlibrc
matplotlib version 0.98.3
verbose.level helpful
interactive is True
units is False
platform is darwin
numerix numpy 1.1.1
$HOME=/Users/nick
CONFIGDIR=/Users/nick/.matplotlib
Using fontManager instance from /Users/nick/.matplotlib/fontManager.cache
backend WXAgg version 2.8.7.1
Traceback (most recent call last):
File "Croizat.py", line 71, in <module>
Croizat = Application(0)
File
"/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/wxPython-2.8.7.1.0003_s-py2.5-macosx-10.3-fat.egg/wx/_core.py",
line 7836, in __init__
self._BootstrapApp()
File
"/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/wxPython-2.8.7.1.0003_s-py2.5-macosx-10.3-fat.egg/wx/_core.py",
line 7433, in _BootstrapApp
return _core_.PyApp__BootstrapApp(*args, **kwargs)
File "Croizat.py", line 62, in OnInit
MainWindow = MainForm(None, -1, "")
File "/home/maurobio/Projetos/Croizat/source/MainForm.py", line 201,
in __init__
File "/home/maurobio/Projetos/Croizat/source/MainForm.py", line 320,
in __do_layout
File "/home/maurobio/Projetos/Croizat/source/MainForm.py", line 1187,
in DrawMap
File
"/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/basemap-0.99.1.0001-py2.5-macosx-10.3-fat.egg/mpl_toolkits/basemap/__init__.py",
line 1361, in drawcoastlines
self.set_axes_limits(ax=ax)
File
"/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/basemap-0.99.1.0001-py2.5-macosx-10.3-fat.egg/mpl_toolkits/basemap/__init__.py",
line 2501, in set_axes_limits
figManager.canvas.draw()
AttributeError: 'NoneType' object has no attribute 'canvas'
mws2:/bioinformatics/croizat/Croizat nick$
===================
Mauro Cavalcanti wrote:
> Dear Nick,
>
> I got this reply from one of the members of the Matplotlib-users
> discussion list. I don't know if it will help, but maybe a start.
>
> Another suggestion I may give you just occurred me yesterday: try
> deleting all the .pyc files included in the "Croizat" distribution
> archive, then go to the /source sub-folder of the installation folder
> and run the Croizat.py file from there. The Python interpreter will
> recompile the code and rebuild the .pyc files in the source folder.
> Maybe this will help. Anyway, let me know the results.
>
> With warmest regards,
>
>
> ---------- Forwarded message ----------
> From: Lionel Roubeyrie <lro...@li...>
> Date: 2009/1/22
> Subject: Re: [Matplotlib-users] Fwd: Croizat on Mac OS X
> To: Matplotlib Users <mat...@li...>
>
>
> Maybe a backend problem, since your soft is based on wx and the user
> uses Tk :
> ...
>> Using fontManager instance from /Users/nick/.matplotlib/fontManager.cache
>> backend TkAgg version 8.4
>> Traceback (most recent call last):
>> File "Croizat.py", line 71, in <module>
>> Croizat = Application(0)
> ...
> --
> Lionel Roubeyrie
> chargé d'études
> LIMAIR - La Surveillance de l'Air en Limousin
> http://www.limair.asso.fr
>
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
> http://p.sf.net/sfu/sf-spreadtheword
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
>
--
====================================================
Nicholas J. Matzke
Ph.D. student, Graduate Student Researcher
Huelsenbeck Lab
Center for Theoretical Evolutionary Genomics
4151 VLSB (Valley Life Sciences Building)
Department of Integrative Biology
University of California, Berkeley
Lab websites:
http://ib.berkeley.edu/people/lab_detail.php?lab=54
http://fisher.berkeley.edu/cteg/hlab.html
Dept. personal page:
http://ib.berkeley.edu/people/students/person_detail.php?person=370
Lab personal page: http://fisher.berkeley.edu/cteg/members/matzke.html
Lab phone: 510-643-6299
Dept. fax: 510-643-6264
Cell phone: 510-301-0179
Email: ma...@be...
Mailing address:
Department of Integrative Biology
3060 VLSB #3140
Berkeley, CA 94720-3140
-----------------------------------------------------
"[W]hen people thought the earth was flat, they were wrong. When people
thought the earth was spherical, they were wrong. But if you think that
thinking the earth is spherical is just as wrong as thinking the earth
is flat, then your view is wronger than both of them put together."
Isaac Asimov (1989). "The Relativity of Wrong." The Skeptical Inquirer,
14(1), 35-44. Fall 1989.
http://chem.tufts.edu/AnswersInScience/RelativityofWrong.htm
====================================================
|
|
From: Nick M. <ma...@be...> - 2009-01-26 20:15:19
|
Hi Mauro,
Update:
1. I went to the place that threw an error in the basemap code:
>>
"/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/basemap-0.99.1.0001-py2.5-macosx-10.3-fat.egg/mpl_toolkits/basemap/__init__.py",
>> line 2501, in set_axes_limits
>> figManager.canvas.draw()
>> AttributeError: 'NoneType' object has no attribute 'canvas'
>>
>>
The code is:
============
# force draw if in interactive mode.
if is_interactive():
figManager = _pylab_helpers.Gcf.get_active()
figManager.canvas.draw()
============
So, I changed "interactive = true" to "interactive = false" in my
matplotlibrc file.
Now when I run "python Croizat.py", I get no error messages, and the
graphic of a world map comes up.
I can get rivers etc. to display correctly.
2. However, I tried opening the America.prj project file, and the
various *.csv files in the /samples directory, and couldn't get anything
to display (perhaps because interactive mode is off?).
When I clicked on the the various analysis options (e.g. track
analysis), I get "Number of data files must be >= 1". This probably
means the files aren't actually loading...
2a. Workaround: When I copied the *.prj file and the *.csv files from
Croizat/sample to the main Croizat directory, then I was able to open
things fine, and run the analyses.
So basically it looks like it works now. Recommend you post this where
appropriate for other users.
Cheers!
Nick
Nick Matzke wrote:
> Hi Mauro & Lionel,
>
> I tried changing the backend to WX (and WxAgg) via the matplotlibrc
> file, but got the same result. Other suggestions welcome!
>
> Nick
>
>
> WX:
> ==================
> mws2:/bioinformatics/croizat/Croizat nick$ py Croizat.py
>
>
> matplotlib data path
> /Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/matplotlib-0.98.3.0001-py2.5-macosx-10.3-fat.egg/matplotlib/mpl-data
>
> loaded rc file /Users/nick/.matplotlib/matplotlibrc
> matplotlib version 0.98.3
> verbose.level helpful
> interactive is True
> units is False
> platform is darwin
> numerix numpy 1.1.1
> $HOME=/Users/nick
> CONFIGDIR=/Users/nick/.matplotlib
> Using fontManager instance from /Users/nick/.matplotlib/fontManager.cache
> backend WX version 2.8.7.1
> Traceback (most recent call last):
> File "Croizat.py", line 71, in <module>
> Croizat = Application(0)
> File
> "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/wxPython-2.8.7.1.0003_s-py2.5-macosx-10.3-fat.egg/wx/_core.py",
> line 7836, in __init__
> self._BootstrapApp()
> File
> "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/wxPython-2.8.7.1.0003_s-py2.5-macosx-10.3-fat.egg/wx/_core.py",
> line 7433, in _BootstrapApp
> return _core_.PyApp__BootstrapApp(*args, **kwargs)
> File "Croizat.py", line 62, in OnInit
> MainWindow = MainForm(None, -1, "")
> File "/home/maurobio/Projetos/Croizat/source/MainForm.py", line 201,
> in __init__
> File "/home/maurobio/Projetos/Croizat/source/MainForm.py", line 320,
> in __do_layout
> File "/home/maurobio/Projetos/Croizat/source/MainForm.py", line 1187,
> in DrawMap
> File
> "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/basemap-0.99.1.0001-py2.5-macosx-10.3-fat.egg/mpl_toolkits/basemap/__init__.py",
> line 1361, in drawcoastlines
> self.set_axes_limits(ax=ax)
> File
> "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/basemap-0.99.1.0001-py2.5-macosx-10.3-fat.egg/mpl_toolkits/basemap/__init__.py",
> line 2501, in set_axes_limits
> figManager.canvas.draw()
> AttributeError: 'NoneType' object has no attribute 'canvas'
> ==================
>
>
> WxAgg:
> ===================
> mws2:/bioinformatics/croizat/Croizat nick$ py Croizat.py
>
>
> matplotlib data path
> /Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/matplotlib-0.98.3.0001-py2.5-macosx-10.3-fat.egg/matplotlib/mpl-data
>
> loaded rc file /Users/nick/.matplotlib/matplotlibrc
> matplotlib version 0.98.3
> verbose.level helpful
> interactive is True
> units is False
> platform is darwin
> numerix numpy 1.1.1
> $HOME=/Users/nick
> CONFIGDIR=/Users/nick/.matplotlib
> Using fontManager instance from /Users/nick/.matplotlib/fontManager.cache
> backend WXAgg version 2.8.7.1
> Traceback (most recent call last):
> File "Croizat.py", line 71, in <module>
> Croizat = Application(0)
> File
> "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/wxPython-2.8.7.1.0003_s-py2.5-macosx-10.3-fat.egg/wx/_core.py",
> line 7836, in __init__
> self._BootstrapApp()
> File
> "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/wxPython-2.8.7.1.0003_s-py2.5-macosx-10.3-fat.egg/wx/_core.py",
> line 7433, in _BootstrapApp
> return _core_.PyApp__BootstrapApp(*args, **kwargs)
> File "Croizat.py", line 62, in OnInit
> MainWindow = MainForm(None, -1, "")
> File "/home/maurobio/Projetos/Croizat/source/MainForm.py", line 201,
> in __init__
> File "/home/maurobio/Projetos/Croizat/source/MainForm.py", line 320,
> in __do_layout
> File "/home/maurobio/Projetos/Croizat/source/MainForm.py", line 1187,
> in DrawMap
> File
> "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/basemap-0.99.1.0001-py2.5-macosx-10.3-fat.egg/mpl_toolkits/basemap/__init__.py",
> line 1361, in drawcoastlines
> self.set_axes_limits(ax=ax)
> File
> "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/basemap-0.99.1.0001-py2.5-macosx-10.3-fat.egg/mpl_toolkits/basemap/__init__.py",
> line 2501, in set_axes_limits
> figManager.canvas.draw()
> AttributeError: 'NoneType' object has no attribute 'canvas'
>
>
> mws2:/bioinformatics/croizat/Croizat nick$
> ===================
>
>
>
>
> Mauro Cavalcanti wrote:
>> Dear Nick,
>>
>> I got this reply from one of the members of the Matplotlib-users
>> discussion list. I don't know if it will help, but maybe a start.
>>
>> Another suggestion I may give you just occurred me yesterday: try
>> deleting all the .pyc files included in the "Croizat" distribution
>> archive, then go to the /source sub-folder of the installation folder
>> and run the Croizat.py file from there. The Python interpreter will
>> recompile the code and rebuild the .pyc files in the source folder.
>> Maybe this will help. Anyway, let me know the results.
>>
>> With warmest regards,
>>
>>
>> ---------- Forwarded message ----------
>> From: Lionel Roubeyrie <lro...@li...>
>> Date: 2009/1/22
>> Subject: Re: [Matplotlib-users] Fwd: Croizat on Mac OS X
>> To: Matplotlib Users <mat...@li...>
>>
>>
>> Maybe a backend problem, since your soft is based on wx and the user
>> uses Tk :
>> ...
>>> Using fontManager instance from
>>> /Users/nick/.matplotlib/fontManager.cache
>>> backend TkAgg version 8.4
>>> Traceback (most recent call last):
>>> File "Croizat.py", line 71, in <module>
>>> Croizat = Application(0)
>> ...
>> --
>> Lionel Roubeyrie
>> chargé d'études
>> LIMAIR - La Surveillance de l'Air en Limousin
>> http://www.limair.asso.fr
>>
>>
>>
>> ------------------------------------------------------------------------------
>>
>> This SF.net email is sponsored by:
>> SourcForge Community
>> SourceForge wants to tell your story.
>> http://p.sf.net/sfu/sf-spreadtheword
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>>
>
--
====================================================
Nicholas J. Matzke
Ph.D. student, Graduate Student Researcher
Huelsenbeck Lab
Center for Theoretical Evolutionary Genomics
4151 VLSB (Valley Life Sciences Building)
Department of Integrative Biology
University of California, Berkeley
Lab websites:
http://ib.berkeley.edu/people/lab_detail.php?lab=54
http://fisher.berkeley.edu/cteg/hlab.html
Dept. personal page:
http://ib.berkeley.edu/people/students/person_detail.php?person=370
Lab personal page: http://fisher.berkeley.edu/cteg/members/matzke.html
Lab phone: 510-643-6299
Dept. fax: 510-643-6264
Cell phone: 510-301-0179
Email: ma...@be...
Mailing address:
Department of Integrative Biology
3060 VLSB #3140
Berkeley, CA 94720-3140
-----------------------------------------------------
"[W]hen people thought the earth was flat, they were wrong. When people
thought the earth was spherical, they were wrong. But if you think that
thinking the earth is spherical is just as wrong as thinking the earth
is flat, then your view is wronger than both of them put together."
Isaac Asimov (1989). "The Relativity of Wrong." The Skeptical Inquirer,
14(1), 35-44. Fall 1989.
http://chem.tufts.edu/AnswersInScience/RelativityofWrong.htm
====================================================
|
|
From: John H. <jd...@gm...> - 2009-01-26 20:29:55
|
On Mon, Jan 26, 2009 at 2:14 PM, Nick Matzke <ma...@be...> wrote: > Hi Mauro, > > Update: > > 1. I went to the place that threw an error in the basemap code: > > >> > "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/basemap-0.99.1.0001-py2.5-macosx-10.3-fat.egg/mpl_toolkits/basemap/__init__.py", > > >> line 2501, in set_axes_limits > >> figManager.canvas.draw() > >> AttributeError: 'NoneType' object has no attribute 'canvas' > >> > >> > > > The code is: > > ============ > # force draw if in interactive mode. > if is_interactive(): > figManager = _pylab_helpers.Gcf.get_active() > figManager.canvas.draw() > ============ > > > So, I changed "interactive = true" to "interactive = false" in my > matplotlibrc file. Croizat is calling pylab here via basemap, which is a bug. Croizat is a wx app, and should never import pylab or pyplot. This is happening somewhere in basemap, most likely a call to basemap is not passing in an axes or figure instance in. When basemap gets a default axes instance of None, it imports pyplot and creates its own. I have no idea why this is happening on one platform and not another for Croizat, but this is where the bug is occurring most likely. A good way to track this down is to remove matplotlib/pyplot.py from site-packages and rerun. The stack trace should show you which Croizat/basemap call is triggering the import, and you can fix it there. The fix you are trying is dangerous, unsupported, and likely to fail in unpredicatable ways. JDH |
|
From: Jeff W. <js...@fa...> - 2009-01-26 20:48:12
|
John Hunter wrote: > On Mon, Jan 26, 2009 at 2:14 PM, Nick Matzke <ma...@be...> wrote: > >> Hi Mauro, >> >> Update: >> >> 1. I went to the place that threw an error in the basemap code: >> >> >> >> "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/basemap-0.99.1.0001-py2.5-macosx-10.3-fat.egg/mpl_toolkits/basemap/__init__.py", >> >> >> line 2501, in set_axes_limits >> >> figManager.canvas.draw() >> >> AttributeError: 'NoneType' object has no attribute 'canvas' >> >> >> >> >> >> >> The code is: >> >> ============ >> # force draw if in interactive mode. >> if is_interactive(): >> figManager = _pylab_helpers.Gcf.get_active() >> figManager.canvas.draw() >> ============ >> >> >> So, I changed "interactive = true" to "interactive = false" in my >> matplotlibrc file. >> > > Croizat is calling pylab here via basemap, which is a bug. Croizat is > a wx app, and should never import pylab or pyplot. This is happening > somewhere in basemap, most likely a call to basemap is not passing in > an axes or figure instance in. When basemap gets a default axes > instance of None, it imports pyplot and creates its own. I have no > idea why this is happening on one platform and not another for > Croizat, but this is where the bug is occurring most likely. > > A good way to track this down is to remove matplotlib/pyplot.py from > site-packages and rerun. The stack trace should show you which > Croizat/basemap call is triggering the import, and you can fix it > there. The fix you are trying is dangerous, unsupported, and likely > to fail in unpredicatable ways. > > JDH > > I think the problem could be solved by having the app explicity set interactive to false (using matplotlib.interactive(False)), instead of letting the users matplotlibrc determine it. From a cursory look at the code, it looks like the app is not letting basemap create it's own axes instance with pyplot. It's just that if basemap finds that is_interactive is True, it will use pyplot for force the canvas to be drawn. -Jeff ---- Jeffrey S. Whitaker Phone : (303)497-6313 Meteorologist FAX : (303)497-6449 NOAA/OAR/PSD R/PSD1 Email : Jef...@no... 325 Broadway Office : Skaggs Research Cntr 1D-113 Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg |
|
From: Lionel R. <lro...@li...> - 2009-01-22 08:56:27
|
Maybe a backend problem, since your soft is based on wx and the user uses Tk : ... > Using fontManager instance from /Users/nick/.matplotlib/fontManager.cache > backend TkAgg version 8.4 > Traceback (most recent call last): > File "Croizat.py", line 71, in <module> > Croizat = Application(0) ... -- Lionel Roubeyrie chargé d'études LIMAIR - La Surveillance de l'Air en Limousin http://www.limair.asso.fr |