numpy.i is missing. What is the recommended way to install it?
numpy, python, swig
Solution
The safest option is probably just to bundle a copy of `numpy.i` with your project, as the file is not currently installed by Numpy itself.
The `numpy.i` file is written using Numpy's C-API, so the backward compatibility questions are the same as if you wrote the corresponding C code by hand.
Problem
I am writing a C++ library which can be called from both C++ and Python by using SWIG-Python interface. I would like to make a few functions in the library to return numpy array when they are used in Python. The SWIG documentation [1] says that `numpy.i` located under `numpy/docs/swig` can be used for this purpose. But I cannot find this directory on the following systems. - Scientific Linux 6.4 (RHEL 6.4 clone) + Python 2.6 + NumPy 1.4 (installed via `yum`) - OS X Mavericks + Python 2.7 + NumPy 1.8 (via `easy_install`) - OS X Mavericks + Python 2.7 + NumPy 1.8 (built from the source `python setup.py install`) There exists `numpy.i` under `numpy-1.8.0/doc/swig` if I get the .tar.gz source code from the NumPy site. But this file is not automatically installed when `python setup.py install` is executed. So I would like to know what the best or recommended way to install `numpy.i` on my system is. As I distribute this library to my colleagues, putting `numpy.i` in my code might be an easy solution. But I am concerning about version mismatch with their NumPy. [1] http://docs.scipy.org/doc/numpy/reference/swig.interface-file.html