1

Trying to make python work in order to use qutip is leading me to self distruction. Today's new issue is in importing numpy. I checked all the other stacks about this error, I couldn't get it fixed. I'm pretty puzzled also because the only thing i did was installing all the packages and checking their installation importing them. The only thing i put hand on was PYTHONPATH to fix another error. I'm using python2.7.12 . The problem is that when i command

import numpy

The ouput is:

 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/usr/lib/python2.7/dist-packages/numpy/__init__.py", line 201, in <module>
     from . import random
   File "/usr/lib/python2.7/dist-packages/numpy/random/__init__.py", line 99, in <module>
     from .mtrand import *
 ImportError: /usr/lib/python2.7/dist-packages/numpy/random/mtrand.so: undefined symbol: PyFPE_jbuf

What does it mean? How do i fix the problem? Numpy is at its newest version, i installed it with apt-get first and then with pip.

mahendra kamble
  • 1,375
  • 1
  • 14
  • 24
PsycoPulcino
  • 111
  • 4
  • I don't think its the same case – PsycoPulcino Oct 13 '16 at 10:50
  • you said that you installed using `apt-get` and then `pip`, but befor installing `numpy` using `pip`, did you uninstalled the old one which is installed by `apt-get` – mahendra kamble Oct 13 '16 at 10:59
  • no. I tryed installing it only with pip, but there was no numpy folder in .../python2.7/dist-packages/ so it didn't work! But if i install it only with apt-get it gives me other errors – PsycoPulcino Oct 13 '16 at 11:18
  • even if i uninstall it with pip so that the only installation is that of apt-get, it gives me the same error – PsycoPulcino Oct 13 '16 at 11:28

1 Answers1

0

These sorts of incompatibilities are much easier to control in a virtualenv (or a conda env). Just make a clean virtualenv and install things into it with pip. (Pip >= 8.1 will likely make it even easier).

Edit: and never ever do sudo pip

ev-br
  • 24,968
  • 9
  • 65
  • 78