I'm new to python and I have problems installing python packages. The one that's giving me a hard time is numpy. When i try to install QuTip, it gives me the error:

Traceback (most recent call last):
 File "setup.py", line 39, in <module>
import numpy as np
ImportError: No module named numpy

OK. It gives me a similar error if in python i command "import numpy"

I found out that numpy might be installed uncorrectly. I entered the root python folder where numpy is and inside numpy folder i run

sudo python setup.py install

It gives me the error:

This is the wrong setup.py file to run

I tryed installing numpy with pip then, but it still gives me loads of errors

    lindi@lindi-ThinkPad-X1-Carbon-2nd:~$ python
    Python 2.7.12 (default, Oct 11 2016, 23:48:08) 
    [GCC 5.4.0 20160609] 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 "/home/lindi/.local/lib/python2.7/site-packages/numpy        /__init__.py", line 142, in <module>
        from . import add_newdocs
      File "/home/lindi/.local/lib/python2.7/site-packages/numpy        /add_newdocs.py", line 13, in <module>
        from numpy.lib import add_newdoc
      File "/home/lindi/.local/lib/python2.7/site-packages/numpy        /lib/__init__.py", line 8, in <module>
        from .type_check import *
      File "/home/lindi/.local/lib/python2.7/site-packages/numpy        /lib/type_check.py", line 11, in <module>
        import numpy.core.numeric as _nx
      File "/home/lindi/.local/lib/python2.7/site-packages/numpy        /core/__init__.py", line 14, in <module>
        from . import multiarray
    ImportError: /home/lindi/.local/lib/python2.7/site-packages/numpy        /core/multiarray.so: undefined symbol:         _PyUnicodeUCS4_IsWhitespace

I don't know what to do now. I need this package to install QuTip. If i try to reinstall numpy it says that it is installed correctly. What do i have to do?

  • Have you tried pip install numpy ? – GrayW Oct 12 '16 at 11:14
  • yes i did, after installing it from its folder didn't work. With pip it installed successfully, but still returned that error. – user129511 Oct 12 '16 at 11:24
  • * i did after installing it from its folder and it didn't work – user129511 Oct 12 '16 at 11:25
  • Hmm ok. So do you actually have the directory /home/lindi/.local/lib/python2.7/site-packages/numpy ? – GrayW Oct 12 '16 at 11:32
  • Ok i solved this problem reconfiguring python in its installation folder with ./configure --enable-unicode=ucs4 . Thank you very much anyway :) – user129511 Oct 12 '16 at 11:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.