[AstroPy] [Astropy] python install prb.

Matthew Craig mcraig at mnstate.edu
Mon Feb 15 18:10:52 EST 2016


Hi Xavier,

Thanks for the details, makes it much easier to track down the issue…which is an error in python4astronomers, not in what you are doing.

This error:

In [7]: print(matplotlib.__version__)
---------------------------------------------------------------------------
                                Traceback (most recent call last)
<ipython-input-7-dc737d9da186> in <module>()
----> 1 print(matplotlib.__version__)

is coming because you imported matplotlib.pyplot but you didn’t import matplotlib itself.

If you add to your list of imports this:

import matplotlib

then you should be able to print the version.

I’ve opened an issue for this at https://github.com/python4astronomers/python4astronomers/issues

Matt Craig

schedule:  http://physics.mnstate.edu/craig
——
Professor
Department of Physics and Astronomy
Minnesota State University Moorhead
1104 7th Ave S, Moorhead MN 56563

office: Hagen 307F
phone: (218) 477-2439
fax: (218) 477-2290

On Feb 15, 2016, at 5:00 PM, Xavier Couvelard <xaviercouvelard at gmail.com<mailto:xaviercouvelard at gmail.com>> wrote:

Hi ,

i kind of got that, but i have no clue of how i should install it.

I am using an ubuntu 14.04 on 64b laptop.
i have python2.7 on it.

I followed all the steps of this webpage.

I installed Anaconda2-2.5.0-Linux-x86_64.sh

and then did:

pip install --upgrade aplpy
pip install --upgrade pyregion
pip install --upgrade pyparsing


i had many warning but all went well and finish with success messages.

So i went for the recommended test;
$ python -V
Python 2.7.11 :: Anaconda 2.5.0 (64-bit)
$ 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

that's almost all what i have done up to now....

hope that will help you understand my problems.

Regards

Le 15/02/2016 22:08, Thøger Emil Rivera-Thorsen a écrit :
This means Matplotlib is not installed or not found by your Python installation.

Can you give some more detailed information about which steps you followed, in which operatng system, etc.?



On 02/15/2016 07:29 PM, Xavier Couvelard wrote:
Hello,

I went through the tutorial https://python4astronomers.github.io/installation/python_install.html to install python, it went well, but at the end i have problem with matplotlib.


In [7]: print(matplotlib.__version__)
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-7-dc737d9da186> in <module>()
----> 1 print(matplotlib.__version__)

NameError: name 'matplotlib' is not defined

If i follow anyway:

In [9]: plt.plot(x, sin(x))
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-9-298a676ae7cb> in <module>()
----> 1 plt.plot(x, sin(x))

Does any one can help ?

Thanks

Xavier
_______________________________________________
AstroPy mailing list
AstroPy at scipy.org<mailto:AstroPy at scipy.org>
https://mail.scipy.org/mailman/listinfo/astropy

_______________________________________________
AstroPy mailing list
AstroPy at scipy.org<mailto:AstroPy at scipy.org>
https://mail.scipy.org/mailman/listinfo/astropy

_______________________________________________
AstroPy mailing list
AstroPy at scipy.org<mailto:AstroPy at scipy.org>
https://mail.scipy.org/mailman/listinfo/astropy

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20160215/7a0267e4/attachment.html>


More information about the AstroPy mailing list