Using Python 2.7.3 with Numpy 1.6.2 on a 64-bit Ubuntu 12.04. Additional versions are present on the system (Python 2.6.4 and Numpy 1.6.1) but to the best of my knowledge these have no influence on the events described below.
I'm working on a Python program which uses Numpy, and getting an error when I try to run a certain command from the program. So, I decided to install python2.7-dbg to run the program with it and see if that can help with debugging. So I run
$ python-dbg <command>
instead of
$ python <command>
However, this gives an "undefined symbol: Py_InitModule4_64" error related to numpy. It doesn't matter what exactly I try to run; the error also occurs for commands that succeed if run with the "regular" python. It occurs even if I try to import numpy into a blank python-dbg prompt:
$ python-dbg
Python 2.7.3 (default, Aug 1 2012, 04:55:00)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/numpy/__init__.py", line 137, in <module>
import add_newdocs
File "/usr/local/lib/python2.7/dist-packages/numpy/add_newdocs.py", line 9, in <module>
from numpy.lib import add_newdoc
File "/usr/local/lib/python2.7/dist-packages/numpy/lib/__init__.py", line 4, in <module>
from type_check import *
File "/usr/local/lib/python2.7/dist-packages/numpy/lib/type_check.py", line 8, in <module>
import numpy.core.numeric as _nx
File "/usr/local/lib/python2.7/dist-packages/numpy/core/__init__.py", line 5, in <module>
import multiarray
ImportError: /usr/local/lib/python2.7/dist-packages/numpy/core/multiarray.so: undefined symbol: Py_InitModule4_64
[134187 refs]
>>>
Importing numpy succeeds when in a pure python prompt.
I've had no luck finding information on the internet. The closest match to my error is this bug on debian which is the exact same situation but has been closed before any further information was provided. I've installed both the python-numpy-dbg and the python-apt-dbg packages from APT; I have sudo access to the machine so the changes I make are valid system-wide. As far as I know, no chroot options have been set for any of the processes I'm trying to run, so the Debian bug page is of no help to me.
Any assistance will be greatly appreciated.