[AstroPy] [Astropy] python install prb.

Derek Homeier derek at astro.physik.uni-goettingen.de
Mon Feb 15 18:12:58 EST 2016


> On 16 Feb 2016, at 12:00 am, Xavier Couvelard <xaviercouvelard at gmail.com> wrote:
> 
> $ ipython -V
> 4.0.3
> $ ipython --matplotlib
> Python 2.7.11 |Anaconda 2.5.0 (64-bit)| (default, Dec  6 2015, 18:08:32)
> Type "copyright", "credits" or "license" for more information.
> 
> IPython 4.0.3 -- An enhanced Interactive Python.
> ?         -> Introduction and overview of IPython's features.
> %quickref -> Quick reference.
> help      -> Python's own help system.
> object?   -> Details about 'object', use 'object??' for extra details.
> Using matplotlib backend: Qt4Agg
> 
> import numpy
> import scipy
> import scipy.linalg
> import matplotlib.pyplot as plt
> 
> 
> In [5]: print(numpy.__version__)
> 1.10.4
> In [6]: print(scipy.__version__)
> 0.17.0
> In [7]: print(matplotlib.__version__)
> ---------------------------------------------------------------------------
>                                 Traceback (most recent call last)
> <ipython-input-7-dc737d9da186> in <module>()
> ----> 1 print(matplotlib.__version__)
> 
> NameError: name 'matplotlib' is not defined
> 
And you are not getting an error on ‘import matplotlib.pyplot as plt’?
Seems then like that tutorial is simply missing a line 

import matplotlib

If you wanted everything imported automatically, you’d have to start up

ipython —pylab

but I don’t know what philosophy the above tutorial is following, so perhaps best
stick with it for now and just at that import statement.

HTH
					Derek




More information about the AstroPy mailing list