Matplotlib problem, Spyder 2.2.0 beta3 (Lion)

336 views
Skip to first unread message

David Nicholls

unread,
Feb 27, 2013, 11:23:09 PM2/27/13
to spyd...@googlegroups.com
Reporting this for a colleague:

On a clean install of Spyder 2.2.0 beta3 Lion dmg (on OS X 10.8), running the Matplotlib example scatterhbist.py (seehttp://matplotlib.org/examples/axes_grid/scatter_hist.html ), the following error occurs:

Traceback (most recent call last):
File "/Users/ralph/scatterhist.py", line 11, in <module>
from mpl_toolkits.axes_grid1 import make_axes_locatable
ImportError: No module named axes_grid1

Same result when running iPyhton:

runfile(r'/Users/ralph/scatterhist.py', wdir=r'/Users/ralph')
Traceback (most recent call last):
File "<ipython-input-1-a52c4829f0a5>", line 1, in <module>
runfile(r'/Users/ralph/scatterhist.py', wdir=r'/Users/ralph')
File "/Applications/Spyder.app/Contents/Resources/lib/python2.7/spyderlib/widgets/externalshell/sitecustomize.py", line 508, in runfile
execfile(filename, namespace)
File "/Users/ralph/scatterhist.py", line 11, in <module>
from mpl_toolkits.axes_grid1 import make_axes_locatable
ImportError: No module named axes_grid1

Is something missing from the Matplotlib setup? Or has he got Python version problems? (He was experimenting with 2 Enthought installs previously, the Free and Academic). Could someone check and see if the same error occurs?

Thanks

DN

Jed Ludlow

unread,
Feb 28, 2013, 10:33:45 AM2/28/13
to spyderlib
Sure sounds like general problem with the Python or Matplotlib install. Try running Python directly in a system terminal and entering "from mpl_toolkits.axes_grid1 import make_axes_locatable". If you still get an ImportError then it's probably not a Spyder issue. 

Ryan Clary

unread,
Mar 1, 2013, 12:03:54 PM3/1/13
to spyd...@googlegroups.com
I think that this may be an oversight in the construction of the standalone Spyder app (dmg bundle). Although I don't know how this would happen.

My standalone Spyder app has the following contents in "/Applications/Spyder.app/Contents/Resources/lib/python2.7/site-packages/mpl_toolkits":
mplot3d

My MacPorts installation of matplotlib 1.2.0 has the following contents in "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mpl_toolkits":
axes_grid
axisartist
axes_grid1
exceltools.py
gtktools.py
mplot3d

Why these are not included int the Spyder.app mpl_toolkits directory, I don't know. As a temporary fix you could just download matplotlib from the website (http://matplotlib.org/downloads.html) and extract the files from mpl_tookits and copy them to the appropriate directory in Spyder.app. However, this would be overwritten when you ever upgrade Spyder.app.

Ryan Clary

On Feb 28, 2013, at 11:20 PM, sutherla...@gmail.com wrote:

> Thanks for posting for me dcn, I've now found my way here.
>
> It looks like a Spyder 2.2b3 OSXLion.dmg setup problem:
>
> 0) On a fresh mac, OSX 10.8.2, no other python installed except the Apple python setup
> 1) mount dmg and drag spyder app into Applications
> 2) Launch Spyder.app, console:
>
> Python 2.7.3 (default, Jul 24 2012, 20:20:13)
> [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
>
> Imported NumPy 1.6.2, SciPy 0.11.0, Matplotlib 1.2.0
> Type "scientific" for more details.
> >>>
>
> 3) open scatter_hist.py from http://matplotlib.org/examples/axes_grid/scatter_hist.html
> 4) run, output:
> Traceback (most recent call last):
> File "/Users/ralph/scatter_hist.py", line 11, in <module>
> from mpl_toolkits.axes_grid1 import make_axes_locatable
> ImportError: No module named axes_grid1
>
> 5) using terminal.app and running python as is doesn't load matplotlib at all, as the main Apple setup is still plain vanilla python.
>
> 6) when I install EnThought Free distribution, I can run scatter_hist.py from the terminal, and it still fails in Spyder.app
>
> Thats about all I think. For now ill use enthought and will try spyder for OSX dmg/app later and see if it gets better later.
>
> R
>
> PS, I use tcsh not bash if that is of any importance.
>
>
> --
> You received this message because you are subscribed to the Google Groups "spyder" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to spyderlib+...@googlegroups.com.
> To post to this group, send email to spyd...@googlegroups.com.
> Visit this group at http://groups.google.com/group/spyderlib?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Carlos Córdoba

unread,
Mar 5, 2013, 11:50:48 AM3/5/13
to spyd...@googlegroups.com
Thanks Ryan for clearly pointing the source of the problem. The thing is
mpl_toolkits is installed as a separate package from matplotlib, so I
have to explicitly list it here:

http://code.google.com/p/spyderlib/source/browse/create_app.py#77

to be added to the app by py2app (matplotlib is not there because it's
detected automatically as being used by Spyder).


I would like to take the opportunity to clarify something: I don't use
nor own a Mac, I'm a Linux guy. I produce the app on my wife's Mac when
she's not around her computer, but I don't have the time to test it
throughly. So if something doesn't work as expected for you, please
don't get discouraged and keep posting these problems here or in our
Issue tracker and I'll try to solve them for the next release.

Cheers,
Carlos


El 01/03/13 12:03, Ryan Clary escribió:

Ryan Clary

unread,
Mar 5, 2013, 12:10:41 PM3/5/13
to spyd...@googlegroups.com
Glad to be of help. Thanks for all of your hard work putting the standalone app together. I can appreciate the difficulty and nuances of developing on multiple platforms.

Ryan
Reply all
Reply to author
Forward
0 new messages