Numpy fails with python-dbg (undefined symbol: Py_InitModule4_64)

前端 未结 1 1306
既然无缘
既然无缘 2021-02-14 00:35

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

1条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-14 01:02

    As confirmed by the OP, the clue here is in the traceback which shows that numpy you're importing is in /usr/local/lib/. However, packages installed by apt go into /usr/lib/pythonX.Y, where as non-Ubuntu Python packages installed with pip, easy_install, etc. are installed under /usr/local/lib/pythonX.Y and supersedes the system packages.

    For now you should uninstall the Numpy you have installed under /usr/local/lib/python2.7/dist-packages in order for the one installed by python-numpy to work. In the future you might be able to have both installed and do something with usercustomize.py to switch between them, but I'm not on an Ubuntu machine right now so I have no way of testing that out.

    0 讨论(0)
提交回复
热议问题