numpy importing at old version
Frank Schima
macsforever2000 at macports.org
Thu Jul 22 08:52:26 PDT 2010
On Jul 21, 2010, at 11:45 PM, nmaxwell wrote:
> I've installed numpy 1.4.1, but when I import it, it's the old version
> (1.2.1), I believe it's the version shipped with this mac. What should I do?
>
>
> b0620l371pa8yb:~ maxwelna$ port search py-numpy
> py-numpy @1.4.1 (python)
> The core utilities for the scientific library scipy for Python
> b0620l371pa8yb:~ maxwelna$ sudo port install py-numpy
> ---> Computing dependencies for py-numpy
> ---> Cleaning py-numpy
> b0620l371pa8yb:~ maxwelna$ python
> Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29)
> [GCC 4.2.1 (Apple Inc. build 5646)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import numpy
>>>> numpy.__version__
> '1.2.1'
That's because you are running the apple installed python. You need to install the python_select port and then type
sudo python_select python24
That will run the (older) python 2.4 from Macports. Is there a reason you want an older version of python? I run the py26-numpy port successfully with python 2.6.
$ ipython
Python 2.6.5 (r265:79063, Jul 8 2010, 16:24:47)
Type "copyright", "credits" or "license" for more information.
IPython 0.10 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object'. ?object also works, ?? prints more.
In [1]: import numpy
In [2]: numpy.__version__
Out[2]: '1.4.1'
Cheers!
Frank
More information about the macports-tickets
mailing list