[Numpy-discussion] building numpy 1.6.2 on OSX 10.6 / Python2.7.3
Dear list, I am trying to build numpy 1.6.2 from source but am running up against a few problems. Platform: OSX10.6.8 Python: 2.7.3 (compiled using gcc 4.2.1) gcc: 4.2.1 gfortran: 4.2.1 I try the normal build sequence: python setup.py build sudo python setup.py install However, when I try to import numpy I get: import numpy Traceback (most recent call last): File stdin, line 1, in module File /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/__init__.py, line 137, in module import add_newdocs File /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/add_newdocs.py, line 9, in module from numpy.lib import add_newdoc File /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/lib/__init__.py, line 4, in module from type_check import * File /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/lib/type_check.py, line 8, in module import numpy.core.numeric as _nx File /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/__init__.py, line 5, in module import multiarray ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/multiarray.so, 2): Symbol not found: _npy_ceil Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/multiarray.so Expected in: flat namespace in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/multiarray.so The numpy source was from the Sourceforge official page. When I run nm on the multiarray module I get: %nm /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/multiarray.so ...snip a lot of stuff U _npy_ceil U _npy_double_to_half U _npy_doublebits_to_halfbits U _npy_float_to_half U _npy_floatbits_to_halfbits U _npy_half_isnan U _npy_half_iszero U _npy_half_le U _npy_half_lt_nonan U _npy_half_to_double U _npy_half_to_float U _npy_halfbits_to_doublebits U _npy_halfbits_to_floatbits So it seems that the _npy_ceil symbol is undefined. I looked at /build/src.macosx-10.6-intel-2.7/numpy/core/include/numpy/config.h and it contains: #define HAVE_CEIL Am I doing something wrong? regards, Andrew -- _ Dr. Andrew Nelson _ ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] how to uninstall numpy
On 6 August 2012 20:07, Alex Clark acl...@aclark.net wrote: On 8/6/12 5:48 AM, Scott Sinclair wrote: On 6 August 2012 11:04, Petro x.pi...@gmail.com wrote: This is a general python question but I will ask it here. To install a new numpy on Debian testing I remove installed version with aptitude purge python-numpy download numpy source code and install numpy with sudo python setup.py install. If I want to remove the installed numpy how do I proceed? Assuming your system Python is 2.7, your numpy should have been installed in /usr/local/lib/python2.7/site-packages/ (or /usr/local/lib/python2.7/dist-packages/ as on Ubuntu?) So something along these lines: $ sudo rm -rf /usr/local/lib/python2.7/site-packages/numpy/ $ sudo rm -rf /usr/local/lib/python2.7/site-packages/numpy-*.egg* $ sudo rm -rf /usr/local/bin/f2py Or if you have pip installed (easy_install pip) you can: $ pip uninstall numpy (it will uninstall things it hasn't installed, which I think should include the console_script f2py?) Unfortunately that won't work in this case. If pip wasn't used to install the package it has no way know what's been installed. That information is stored in site-packages/package-ver-pyver.egg-info/installed-files.txt which doesn't exist if pip isn't used for the install. Cheers, Scott ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] building numpy 1.6.2 on OSX 10.6 / Python2.7.3
Andrew, I'm afraid you did. It's generally considered a very bad idea(™) to install NumPy on a recent OSX system without specifying a destination. By default, the process will try to install on /Library/Frameworks/Python, overwriting the pre-installed version of NumPy that comes with your machine. You probably don't want to do that. However, using either the --user flag or a virtual environment ( http://www.virtualenv.org/ http://www.virtualenv.org/en/latest/) works pretty well. EG `python setup.py install --user` should install bumpy in a ~/.local directory, you'll just have to update your PYTHONPATH Good luck -- Pierre GM On Tuesday, August 7, 2012 at 08:15 , Andrew Nelson wrote: Dear list, I am trying to build numpy 1.6.2 from source but am running up against a few problems. Platform: OSX10.6.8 Python: 2.7.3 (compiled using gcc 4.2.1) gcc: 4.2.1 gfortran: 4.2.1 I try the normal build sequence: python setup.py build sudo python setup.py install However, when I try to import numpy I get: import numpy Traceback (most recent call last): File stdin, line 1, in module File /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/__init__.py, line 137, in module import add_newdocs File /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/add_newdocs.py, line 9, in module from numpy.lib import add_newdoc File /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/lib/__init__.py, line 4, in module from type_check import * File /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/lib/type_check.py, line 8, in module import numpy.core.numeric as _nx File /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/__init__.py, line 5, in module import multiarray ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/multiarray.so, 2): Symbol not found: _npy_ceil Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/multiarray.so Expected in: flat namespace in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/multiarray.so The numpy source was from the Sourceforge official page. When I run nm on the multiarray module I get: %nm /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/multiarray.so ...snip a lot of stuff U _npy_ceil U _npy_double_to_half U _npy_doublebits_to_halfbits U _npy_float_to_half U _npy_floatbits_to_halfbits U _npy_half_isnan U _npy_half_iszero U _npy_half_le U _npy_half_lt_nonan U _npy_half_to_double U _npy_half_to_float U _npy_halfbits_to_doublebits U _npy_halfbits_to_floatbits So it seems that the _npy_ceil symbol is undefined. I looked at /build/src.macosx-10.6-intel-2.7/numpy/core/include/numpy/config.h and it contains: #define HAVE_CEIL Am I doing something wrong? regards, Andrew -- _ Dr. Andrew Nelson _ ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] how to uninstall numpy
Here's a good article on the vagaries of python paths when installing a new python. Thus you can check exactly how python finds its modules, to assure the new install is working properly: https://www.usenix.org/publications/login/august-2012-volume-37-number-4/import John Mark Agosta jmago...@us.toyota-itc.com TOYOTA InfoTechnology Center USA www.us.toyota-itc.com 465 Bernardo Avenue, Mountain View, CA 94043 Phone: (650) 694-4150 Fax: (650) 694-4901 On Aug 6, 2012, at 2:07 PM, Alex Clark wrote: On 8/6/12 5:48 AM, Scott Sinclair wrote: On 6 August 2012 11:04, Petro x.pi...@gmail.com wrote: This is a general python question but I will ask it here. To install a new numpy on Debian testing I remove installed version with aptitude purge python-numpy download numpy source code and install numpy with sudo python setup.py install. If I want to remove the installed numpy how do I proceed? Assuming your system Python is 2.7, your numpy should have been installed in /usr/local/lib/python2.7/site-packages/ (or /usr/local/lib/python2.7/dist-packages/ as on Ubuntu?) So something along these lines: $ sudo rm -rf /usr/local/lib/python2.7/site-packages/numpy/ $ sudo rm -rf /usr/local/lib/python2.7/site-packages/numpy-*.egg* $ sudo rm -rf /usr/local/bin/f2py Or if you have pip installed (easy_install pip) you can: $ pip uninstall numpy (it will uninstall things it hasn't installed, which I think should include the console_script f2py?) Alex Cheers, Scott -- Alex Clark · http://pythonpackages.com/ONE_CLICK ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] question about scipy superpack
On Mon, Aug 6, 2012 at 8:51 PM, Tom Krauss thomas.p.kra...@gmail.com wrote: I got a new job, and a new mac book pro on which I just installed Mac OS X 10.8. congrats -- on the job, and on an employer that gets you a mac! I need to run SWIG to generate a shared object from C++ source that works with numpy.i. I'm considering installing the Scipy Superpack, but I have a question. If I install the Scipy Superpack, which has most of the packages I need, plus some others, will it be able to find numpy/arrayobject.h It's probably there, yes, and you should be able to find it with: numpy.get_include() (use that in your setup.py) the source files needed by gcc to compile the swig-generated C++ wrapper? The trick here is which gcc -- Apple is fast to move forward, is on the bleeding edge with gcc -- the latest XCode uses LLVM, which is not compatible with older Python builds. I *think* the superpack is build against the pyton.org python builds (32 bit?) Anyway, the python,org 32 bit build requires an older gcc for building extensions -- you can get XCode 3from Apple Developer connection if you dig for it -- it works fine on 10.7, I hope it does on 10.8. I'm not totally sure about the 32/64 bit Intel build. The pythonmac list will be a help here. Good luck, -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/ORR(206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception chris.bar...@noaa.gov ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] building numpy 1.6.2 on OSX 10.6 / Python2.7.3
On Tue, Aug 7, 2012 at 5:00 AM, Pierre GM pgmdevl...@gmail.com wrote: It's generally considered a very bad idea(™) to install NumPy on a recent OSX system without specifying a destination. By default, the process will try to install on /Library/Frameworks/Python, overwriting the pre-installed version of NumPy that comes with your machine. Indeed, you want to be careful about this, but Apple puts theirs in: /System/Library/Frameworks/Python.framework/ /Library/Frameworks... Is the default location for Python.org builds -- and a fine place to put it. (though you might have clashes if you try to install binaries build for the python.org builds But I wonder if this has anything to do with the OP's problem anyway... Sorry I'm not more help -- I've managed to avoid building python myself so far. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/ORR(206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception chris.bar...@noaa.gov ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] question about scipy superpack
A little off-topic, but related: Which python version do you recommend to install in Mac OS X 10.8? The native one? The one from python.org? or the one compiled via homebrew? And do you think it's better to use the 32 or 64 bits? Thanks! On Tue, Aug 7, 2012 at 12:35 PM, Chris Barker chris.bar...@noaa.gov wrote: On Mon, Aug 6, 2012 at 8:51 PM, Tom Krauss thomas.p.kra...@gmail.com wrote: I got a new job, and a new mac book pro on which I just installed Mac OS X 10.8. congrats -- on the job, and on an employer that gets you a mac! I need to run SWIG to generate a shared object from C++ source that works with numpy.i. I'm considering installing the Scipy Superpack, but I have a question. If I install the Scipy Superpack, which has most of the packages I need, plus some others, will it be able to find numpy/arrayobject.h It's probably there, yes, and you should be able to find it with: numpy.get_include() (use that in your setup.py) the source files needed by gcc to compile the swig-generated C++ wrapper? The trick here is which gcc -- Apple is fast to move forward, is on the bleeding edge with gcc -- the latest XCode uses LLVM, which is not compatible with older Python builds. I *think* the superpack is build against the pyton.org python builds (32 bit?) Anyway, the python,org 32 bit build requires an older gcc for building extensions -- you can get XCode 3from Apple Developer connection if you dig for it -- it works fine on 10.7, I hope it does on 10.8. I'm not totally sure about the 32/64 bit Intel build. The pythonmac list will be a help here. Good luck, -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/ORR(206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception chris.bar...@noaa.gov ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] question about scipy superpack
On Tue, Aug 7, 2012 at 5:35 PM, Chris Barker chris.bar...@noaa.gov wrote: On Mon, Aug 6, 2012 at 8:51 PM, Tom Krauss thomas.p.kra...@gmail.com wrote: I got a new job, and a new mac book pro on which I just installed Mac OS X 10.8. congrats -- on the job, and on an employer that gets you a mac! I need to run SWIG to generate a shared object from C++ source that works with numpy.i. I'm considering installing the Scipy Superpack, but I have a question. If I install the Scipy Superpack, which has most of the packages I need, plus some others, will it be able to find numpy/arrayobject.h It's probably there, yes, and you should be able to find it with: numpy.get_include() (use that in your setup.py) the source files needed by gcc to compile the swig-generated C++ wrapper? The trick here is which gcc -- Apple is fast to move forward, is on the bleeding edge with gcc -- the latest XCode uses LLVM, which is not compatible with older Python builds. I *think* the superpack is build against the pyton.org python builds (32 bit?) No, it says at http://fonnesbeck.github.com/ScipySuperpack/ that it's built against 64-bit Apple Python. Ralf Anyway, the python,org 32 bit build requires an older gcc for building extensions -- you can get XCode 3from Apple Developer connection if you dig for it -- it works fine on 10.7, I hope it does on 10.8. I'm not totally sure about the 32/64 bit Intel build. The pythonmac list will be a help here. Good luck, -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/ORR(206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception chris.bar...@noaa.gov ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] question about scipy superpack
I'm on 10.8 and am using the Apple Mac OS X Mountain Lion python (2.7.2). Here's what I ended up doing, FWIW: - I installed pip (sudu easy_install pip) - I installed virtualenv - created a new virtual environment [recommended since superpack installs a bunch of development versions of the packages and updates fairly often] - ran the scipy superpack install script - it installed DateUtils 0.5.2, which is way old - I removed it and installed 1.5 instead (with easy_install python-dateutil==1.5) Result: ipython and SWIG are now running just fine for my code, but I got some errors in the scipy tests which I need to follow up on. Also, I got a message that gfortran failed to install because I didn't sudo since I thought I didn't need to because I was installing to a virtual environment. Not sure if scipy errors are related to gfortran missing. Thanks to Mr. Chris Fonnesbeck for publishing the Scipy Superpack, you saved me a ton of time! The answer to my specific question is that yes, the arrayobject.h header is included in the numpy egg, which is easy to see since eggs are really just directories (last night I thought they were some kind of binary)! Further note, I had to change ipython's pylab setting to osx. On Tue, Aug 7, 2012 at 1:07 PM, Ralf Gommers ralf.gomm...@gmail.com wrote: On Tue, Aug 7, 2012 at 6:05 PM, Thiago Franco Moraes totonixs...@gmail.com wrote: A little off-topic, but related: Which python version do you recommend to install in Mac OS X 10.8? The native one? The one from python.org? or the one compiled via homebrew? And do you think it's better to use the 32 or 64 bits? Depends on what you want to do / what packages you want to use. Perhaps python.org + official installers (dmgs from Sourceforge), perhaps EPD / SciPy Superpack / Without knowing more, I would just advise to not use Apple Python, and to use binary installers (10.8 is so fresh, you'll likely run into a few issues with source installs). Ralf ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Indexing API
On Thu, Jul 19, 2012 at 2:53 PM, Travis Oliphant tra...@continuum.io wrote: On Jul 19, 2012, at 3:50 AM, Nathaniel Smith wrote: So the underlying problem with the controversial inplace_increment PR[1] is that currently, there's actually nothing in the public numpy API that exposes the workings of numpy indexing. The only thing you can do with a numpy index is call ndarray.__getattr__ or __setattr__. This is a pretty obvious gap, given how fundamental an operation indexing is in numpy (and how difficult to emulate). So how can we expose something that fixes it? Make PyArrayMapIterObject part of the public API? Something else? I think you meant ndarray.__getitem__ and ndarray.__setitem__ As I mentioned in the comments, the original intention was to make PyArrayMapIterObject part of the public API. However, I was not able to make it work in the way I had intended back then. Exposing the MapIterObject is a good idea (but it would have to be exposed already bound to an array) --- i.e. you create a new API that binds to a particular array and then expose the PyArray_MapIterNext, etc. functions. Perhaps something like: PyArray_MapIterArray There's now a PR for exposing this: https://github.com/numpy/numpy/pull/377 Since this is new API I hope people will take a look :-). The patch itself is pretty trivial, but it exposes an object that seems to have been only partially implemented, so we should also double-check that this isn't exposing any half-baked code. (mapping.c still says Do not expose the MapIter_Type to Python, but I'm not really clear what the problems are. AFAICT it doesn't actually define *any* Python-accessible API, it's just an opaque object.) -n ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] building numpy 1.6.2 on OSX 10.6 / Python2.7.3
Dear Pierre, as indicated yesterday OSX system python is in: /System/Library/Frameworks/Python.framework/ I am installing into: /Library/Frameworks/Python.framework/Versions/Current/lib/python2.7/site-packages This should not present a problem and does not explain why numpy does not build/import correctly on my setup. regards, Andrew. Date: Tue, 7 Aug 2012 14:00:58 +0200 From: Pierre GM pgmdevl...@gmail.com Subject: Re: [Numpy-discussion] building numpy 1.6.2 on OSX 10.6 / Python2.7.3 Andrew, I'm afraid you did. It's generally considered a very bad idea(?) to install NumPy on a recent OSX system without specifying a destination. By default, the process will try to install on /Library/Frameworks/Python, overwriting the pre-installed version of NumPy that comes with your machine. You probably don't want to do that. However, using either the --user flag or a virtual environment ( http://www.virtualenv.org/ http://www.virtualenv.org/en/latest/) works pretty well. EG `python setup.py install --user` should install bumpy in a ~/.local directory, you'll just have to update your PYTHONPATH Good luck -- Pierre GM On Tuesday, August 7, 2012 at 08:15 , Andrew Nelson wrote: Dear list, I am trying to build numpy 1.6.2 from source but am running up against a few problems. Platform: OSX10.6.8 Python: 2.7.3 (compiled using gcc 4.2.1) gcc: 4.2.1 gfortran: 4.2.1 I try the normal build sequence: python setup.py build sudo python setup.py install However, when I try to import numpy I get: import numpy Traceback (most recent call last): File stdin, line 1, in module File /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/__init__.py, line 137, in module import add_newdocs File /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/add_newdocs.py, line 9, in module from numpy.lib import add_newdoc File /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/lib/__init__.py, line 4, in module from type_check import * File /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/lib/type_check.py, line 8, in module import numpy.core.numeric as _nx File /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/__init__.py, line 5, in module import multiarray ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/multiarray.so, 2): Symbol not found: _npy_ceil Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/multiarray.so Expected in: flat namespace in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/multiarray.so The numpy source was from the Sourceforge official page. When I run nm on the multiarray module I get: %nm /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/multiarray.so ...snip a lot of stuff U _npy_ceil U _npy_double_to_half U _npy_doublebits_to_halfbits U _npy_float_to_half U _npy_floatbits_to_halfbits U _npy_half_isnan U _npy_half_iszero U _npy_half_le U _npy_half_lt_nonan U _npy_half_to_double U _npy_half_to_float U _npy_halfbits_to_doublebits U _npy_halfbits_to_floatbits So it seems that the _npy_ceil symbol is undefined. I looked at /build/src.macosx-10.6-intel-2.7/numpy/core/include/numpy/config.h and it contains: #define HAVE_CEIL Am I doing something wrong? regards, Andrew -- _ Dr. Andrew Nelson _ ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion -- next part -- An HTML attachment was scrubbed... URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20120807/24322fc4/attachment.html -- ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion End of NumPy-Discussion Digest, Vol 71, Issue 11 -- _ Dr. Andrew Nelson _ ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion