installating matplotlib in mac 10.7.4 for python 2.6

I have tried to install matplotlib but received an error msg that I need
python 2.7.
I installed 2.7, then installed matplotlib for appropriate os, but recieved
error msg when I ran my program. Then, searching, I am seeing there are
some that have installed matplotlib for mac osx and python 2.6

Can someone direct me to a useful link to learn more, or does someone have
info about this, like what I am overlooking or missing?
thanks,
lulu

···

--
View this message in context: http://matplotlib.1069221.n5.nabble.com/installating-matplotlib-in-mac-10-7-4-for-python-2-6-tp39436.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Where are you downloading the installation from? It sounds like the problem lies with the installation.

You don't want to install for python 2.6. Python 2.6 is out of date at this point.

If you have xcode tools installed, you could install from source, but that requires a bit more work.

Paul

···

On 10/13/12 8:55 PM, lulu wrote:

I have tried to install matplotlib but received an error msg that I need
python 2.7.
I installed 2.7, then installed matplotlib for appropriate os, but recieved
error msg when I ran my program. Then, searching, I am seeing there are
some that have installed matplotlib for mac osx and python 2.6

Can someone direct me to a useful link to learn more, or does someone have
info about this, like what I am overlooking or missing?
thanks,
lulu

I've installed from the http://matplotlib.org site.
I have also looked on other discussions, and am finding that I need to
install Xcode, which I am trying to do now.

the work I have made on python 2.6 - will this be transferrable to 2.7?

Honestly, I am just trying to plot a very simple x/y program.

Thanks

···

--
View this message in context: http://matplotlib.1069221.n5.nabble.com/installating-matplotlib-in-mac-10-7-4-for-python-2-6-tp39436p39438.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

I disagree. Most of the tools and libraries for 2.6 are available for
2.7 and viceversa (they are quite similar), but not all of them. In
fact, in my experience, I have found more compatibility for 2.6 than
for 2.7.

In most practical scenarios, they will be just the same, but if all
your work has been developed in 2.6 and you are not aware of the
changes introduced by 2.7, it may be unwise to switch uncarefully
(even though the Python deprecation policy is supposed to minimise
this kind of problems).

Lulu, if you just want something that works, you can use macports
(macports.org), and install everything from there. Easy and fail
proof.

···

On Sun, Oct 14, 2012 at 3:42 AM, Paul Tremblay <paulhtremblay@...287...> wrote:

You don't want to install for python 2.6. Python 2.6 is out of date at
this point.

Okay -- that's good to know.
I've just installed macports, but am not sure how to go about using
matplotlib in my python 2.6 - or even 2.7 at this point becuase I installed
that version too.
I also installed xcode....

geez - this is getting soooo confusing!

···

--
View this message in context: http://matplotlib.1069221.n5.nabble.com/installating-matplotlib-in-mac-10-7-4-for-python-2-6-tp39436p39440.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

in the terminal type:

sudo port install py26-python
sudo port install py26-matplotlib

and there you are!

···

On Sun, Oct 14, 2012 at 5:37 AM, lulu <lauracurry1@...2904...> wrote:

Okay -- that's good to know.
I've just installed macports, but am not sure how to go about using
matplotlib in my python 2.6 - or even 2.7 at this point becuase I installed
that version too.
I also installed xcode....

geez - this is getting soooo confusing!

--
View this message in context: http://matplotlib.1069221.n5.nabble.com/installating-matplotlib-in-mac-10-7-4-for-python-2-6-tp39436p39440.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

okay - that sounds easy enough.
I am working in the python shell -- just type these lines at the top of my
code?

···

--
View this message in context: http://matplotlib.1069221.n5.nabble.com/installating-matplotlib-in-mac-10-7-4-for-python-2-6-tp39436p39442.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

No. Not in the python shell. In the regular shell.

···

On 10/13/12 11:43 PM, lulu wrote:

okay - that sounds easy enough.
I am working in the python shell -- just type these lines at the top of my
code?

--
View this message in context: http://matplotlib.1069221.n5.nabble.com/installating-matplotlib-in-mac-10-7-4-for-python-2-6-tp39436p39442.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

Okay --
I opened terminal, typed 'python' to being, then typed:
sudo port install py26-python
sudo port install py26-matplotlib

I recieved syntax errors:

sudo port install py26-python

  File "<stdin>", line 1
    sudo port install py26-python
            ^
SyntaxError: invalid syntax

sudo port install py26-matplotlib

  File "<stdin>", line 1
    sudo port install py26-matplotlib

···

--
View this message in context: http://matplotlib.1069221.n5.nabble.com/installating-matplotlib-in-mac-10-7-4-for-python-2-6-tp39436p39444.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Okay --
I opened terminal, typed 'python' to being, then typed:

There's the problem: don't type "python" to begin, just type the lines below directly in the terminal window.

Eric

···

On 2012/10/13 6:03 PM, lulu wrote:

sudo port install py26-python
sudo port install py26-matplotlib

I recieved syntax errors:

sudo port install py26-python

   File "<stdin>", line 1
     sudo port install py26-python
             ^
SyntaxError: invalid syntax

sudo port install py26-matplotlib

   File "<stdin>", line 1
     sudo port install py26-matplotlib

--
View this message in context: http://matplotlib.1069221.n5.nabble.com/installating-matplotlib-in-mac-10-7-4-for-python-2-6-tp39436p39444.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

okay - thanks...
so I did THAT - but am prompted for a password.
I assumed the password would be my administrator, but it isn't.....
Where would I find that?

btw - thank you ALL for all the help!

···

--
View this message in context: http://matplotlib.1069221.n5.nabble.com/installating-matplotlib-in-mac-10-7-4-for-python-2-6-tp39436p39446.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

okay - thanks...
so I did THAT - but am prompted for a password.
I assumed the password would be my administrator, but it isn't.....
Where would I find that?

Sudo is prompting you for your user password. Depending on how your machine was set up, you might not have permission to use sudo. Sudo is a mechanism for allowing users to do things that would otherwise require the highest level of permissions.

Eric

···

On 2012/10/13 6:11 PM, lulu wrote:

btw - thank you ALL for all the help!

--
View this message in context: http://matplotlib.1069221.n5.nabble.com/installating-matplotlib-in-mac-10-7-4-for-python-2-6-tp39436p39446.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

oh brother -- so now I've got to deal w/ Apple...
okay thanks.

here's where I am.

I've downloaded matplotlib, numpy, python 2.7.3, xcode and macports to
simply plot this oh-so-simple code!
Which is:

Curve fitting with python and pylab
#import the lib
from pylab import *
# assuming this data set
t = (0,5,10,15,20,25,30,35,40,50)
V = (1,7,14,15,16,22,25,27,28,30)
#show the data
plot(t, v, linewidth=2.0)
#assume an order
N = ?
#find the coefficient of the polynomial
coeffs = polyfit(t,v,N)
#get the polynomial output for the input
best = polyval(coeffs, t)
#print the coefficients
print(coeffs)

I have written it like this in python 2.6:

import os,sys
import numpy
#import pylab

t = (0,5,10,15,20,25,30,35,40,50)
V = (1,7,14,15,16,22,25,27,28,30)
#scipy.plot(t,v,linewidth=2.0)

n = 4
coeffs = numpy.polyfit(t,V,n)

best = numpy.polyval(coeffs,t)

print coeffs
print best

and when I run the program, I get this:
[ -1.68165168e-05 1.71262071e-03 -6.39152514e-02 1.59163337e+00
   1.04578755e+00]
[ 1.04578755 7.60964036 12.11505162 15.46811522 18.32267732
  21.08033633 23.89044289 26.6500999 29.0041625 29.81368631]

when I run in 2.7.3 it looks like this:
import os,sys
import numpy as np
import pylab

t = (0,5,10,15,20,25,30,35,40,50)
V = (1,7,14,15,16,22,25,27,28,30)
#scipy.plot(t,v,linewidth=2.0)

n = 4
coeffs = numpy.polyfit(t,V,n)

best = numpy.polyval(coeffs,t)

print coeffs
print best

And my error msg is this:
ImportError: No module named numpy

any ideas?
What I'm looking for is a visual.

···

--
View this message in context: http://matplotlib.1069221.n5.nabble.com/installating-matplotlib-in-mac-10-7-4-for-python-2-6-tp39436p39448.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

oh brother -- so now I've got to deal w/ Apple...

I don't see what Apple has to do with it.

okay thanks.

here's where I am.

I've downloaded matplotlib, numpy, python 2.7.3, xcode and macports to
simply plot this oh-so-simple code!
Which is:

Curve fitting with python and pylab
#import the lib
from pylab import *
# assuming this data set
t = (0,5,10,15,20,25,30,35,40,50)
V = (1,7,14,15,16,22,25,27,28,30)
#show the data
plot(t, v, linewidth=2.0)
#assume an order
N = ?
#find the coefficient of the polynomial
coeffs = polyfit(t,v,N)
#get the polynomial output for the input
best = polyval(coeffs, t)
#print the coefficients
print(coeffs)

I have written it like this in python 2.6:

import os,sys
import numpy
#import pylab

t = (0,5,10,15,20,25,30,35,40,50)
V = (1,7,14,15,16,22,25,27,28,30)
#scipy.plot(t,v,linewidth=2.0)

n = 4
coeffs = numpy.polyfit(t,V,n)

best = numpy.polyval(coeffs,t)

print coeffs
print best

and when I run the program, I get this:
[ -1.68165168e-05 1.71262071e-03 -6.39152514e-02 1.59163337e+00
    1.04578755e+00]
[ 1.04578755 7.60964036 12.11505162 15.46811522 18.32267732
   21.08033633 23.89044289 26.6500999 29.0041625 29.81368631]

when I run in 2.7.3 it looks like this:
import os,sys
import numpy as np
import pylab

t = (0,5,10,15,20,25,30,35,40,50)
V = (1,7,14,15,16,22,25,27,28,30)
#scipy.plot(t,v,linewidth=2.0)

n = 4
coeffs = numpy.polyfit(t,V,n)

best = numpy.polyval(coeffs,t)

print coeffs
print best

And my error msg is this:
ImportError: No module named numpy

any ideas?

The problem in python 2.7 starts with the fact that numpy is evidently not installed for 2.7. Each version of python has its own set of libraries, so installing numpy for 2.6 does nothing for 2.7, and vice-versa.

What I'm looking for is a visual.

With python 2.6, you may be almost there. Try running this in python 2.6:

import numpy as np
import matplotlib.pyplot as plt

t = (0,5,10,15,20,25,30,35,40,50)
V = (1,7,14,15,16,22,25,27,28,30)
plt.plot(t, V, linewidth=2.0)

n = 4
coeffs = np.polyfit(t,V,n)

best = np.polyval(coeffs,t)

print coeffs
print best
plt.show()

Eric

···

On 2012/10/13 6:41 PM, lulu wrote:

Thanks Eric-
I ran this in python 2.6, and got this error:

Traceback (most recent call last):
  File "/Users/laura/Desktop/Bohlen10_12_12.py", line 3, in <module>
    import matplotlib.pyplot as plt
ImportError: No module named matplotlib.pyplot

So, I am installing matplotlib again.

···

--
View this message in context: http://matplotlib.1069221.n5.nabble.com/installating-matplotlib-in-mac-10-7-4-for-python-2-6-tp39436p39451.html
Sent from the matplotlib - users mailing list archive at Nabble.com.