Header files missing, cannot install scipy

Create issue
Issue #63 new
Marshal Hayes created an issue

I have spent a couple of hours trying to install numpy and scipy on Mac OS 10.14.2 (18C54) under pypy. I was able to install numpy with relatively few issues (even though np.test('full') fails miserably, but the scipy setup.py script (latest github repo version) is not working properly for me.

The error messages are all related to a numpy header file not being found: 'numpy/npy_math.h'. After further inspection

import numpy as np
np.get_include()

returns '/usr/local/Cellar/pypy/6.0.0/libexec/include/_numpypy/'. This appears to be the correct location for my system. However, it seems that the 'npy_math.h' file is missing from that directory.

I'm not sure what to do next to resolve the installation problems. Any suggestions?

Version info:

  • Python 2.7.13 (ab0b9caf307db6592905a80b8faffd69b39005b8, Sep 30 2018, 13:54:57) [PyPy 6.0.0 with GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.11.45.2)] on darwin
  • Numpy version = '1.10.0'
  • Mac OS X (10.14.2)

Comments (6)

  1. mattip

    You should not be using pypy/numpy, it is wayyyyy out of date and needs lots of help to work properly. On the other hand, vanilla numpy from https://github.com/numpy/numpy, which can be installed with pip install numpy==1.15.4, should just work.

    Out of curiosity, why did you choose to use this program rather than vanilla numpy? Are there still references to it working somewhere?

  2. Marshal Hayes reporter

    Oh, I thought I was using the most recent version. My mistake. I tried the version you listed above, and the installation was successful. However, when I try to import numpy as np, it throws the following error.

      ~ pypy
    Python 2.7.13 (ab0b9caf307db6592905a80b8faffd69b39005b8, Sep 30 2018, 13:54:57)
    [PyPy 6.0.0 with GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.11.45.2)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>>> import numpy as np
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/local/Cellar/pypy/6.0.0/libexec/site-packages/numpy/__init__.py", line 142, in <module>
        from . import add_newdocs
      File "/usr/local/Cellar/pypy/6.0.0/libexec/site-packages/numpy/add_newdocs.py", line 13, in <module>
        from numpy.lib import add_newdoc
      File "/usr/local/Cellar/pypy/6.0.0/libexec/site-packages/numpy/lib/__init__.py", line 8, in <module>
        from .type_check import *
      File "/usr/local/Cellar/pypy/6.0.0/libexec/site-packages/numpy/lib/type_check.py", line 11, in <module>
        import numpy.core.numeric as _nx
      File "/usr/local/Cellar/pypy/6.0.0/libexec/site-packages/numpy/core/__init__.py", line 35, in <module>
        from . import _internal  # for freeze programs
      File "/usr/local/Cellar/pypy/6.0.0/libexec/site-packages/numpy/core/_internal.py", line 18, in <module>
        from .numerictypes import object_
      File "/usr/local/Cellar/pypy/6.0.0/libexec/site-packages/numpy/core/numerictypes.py", line 297, in <module
    >
        _add_types()
      File "/usr/local/Cellar/pypy/6.0.0/libexec/site-packages/numpy/core/numerictypes.py", line 290, in _add_ty
    pes
        allTypes[name] = info.type
    AttributeError: 'tuple' object has no attribute 'type'
    >>>>
    
  3. Marshal Hayes reporter

    Numpy version 1.15.4 appears to work with pypy3 ... Now I'm going to continue trying to install scipy.

  4. Marshal Hayes reporter

    This occurs after attempting to pypy3 setup.py install scipy from source: https://github.com/scipy/scipy

    /usr/local/bin/gfortran -Wall -g -Wall -g -undefined dynamic_lookup -bundle build/temp.macosx-10.14-x86_64-3.5/scipy/cluster/_vq.o -L/usr/lib -L/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin18.0.0/8.2.0 -L/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin18.0.0/8.2.0/../../.. -L/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin18.0.0/8.2.0/../../.. -Lbuild/temp.macosx-10.14-x86_64-3.5 -llapack -llapack -lblas -lblas -lgfortran -o build/lib.macosx-10.14-x86_64-3.5/scipy/cluster/_vq.pypy3-60-darwin.so
    ld: library not found for -lgcc_s.10.4
    collect2: error: ld returned 1 exit status
    ld: library not found for -lgcc_s.10.4
    collect2: error: ld returned 1 exit status
    error: Command "/usr/local/bin/gfortran -Wall -g -Wall -g -undefined dynamic_lookup -bundle build/temp.macosx-10.14-x86_64-3.5/scipy/cluster/_vq.o -L/usr/lib -L/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin18.0.0/8.2.0 -L/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin18.0.0/8.2.0/../../.. -L/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin18.0.0/8.2.0/../../.. -Lbuild/temp.macosx-10.14-x86_64-3.5 -llapack -llapack -lblas -lblas -lgfortran -o build/lib.macosx-10.14-x86_64-3.5/scipy/cluster/_vq.pypy3-60-darwin.so" failed with exit status 1
    

    A similar message appears when simply executing pip_pypy3 install scipy.

  5. Log in to comment