0

I am following a specific workflow on a mac that requires installation of

numpy==1.12.1 
Fiona==1.7.5
rasterstats==0.12.0
Shapely==1.5.17
pandas==0.19.2

in python3 using a virtual environment. I have to install numpy independently before installing the other packages in the requirements.txt.

When I run pip3 install numpy==1.12.1 the installation fails during the wheel build, with a long error log:

Collecting numpy==1.12.1
  Using cached numpy-1.12.1.zip (4.8 MB)
Building wheels for collected packages: numpy
  Building wheel for numpy (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/rachaelherman/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/c5/ffhgkw8j78q3trry_081nlqh0000gn/T/pip-install-2dnfsql5/numpy/setup.py'"'"'; __file__='"'"'/private/var/folders/c5/ffhgkw8j78q3trry_081nlqh0000gn/T/pip-install-2dnfsql5/numpy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/c5/ffhgkw8j78q3trry_081nlqh0000gn/T/pip-wheel-4_wii8z6
       cwd: /private/var/folders/c5/ffhgkw8j78q3trry_081nlqh0000gn/T/pip-install-2dnfsql5/numpy/
  Complete output (4271 lines):
  Running from numpy source directory.
  blas_opt_info:
  blas_mkl_info:
    libraries mkl_rt not found in ['/Users/rachaelherman/venv/lib', '/usr/local/lib', '/usr/lib']
    NOT AVAILABLE
  
  blis_info:
    libraries blis not found in ['/Users/rachaelherman/venv/lib', '/usr/local/lib', '/usr/lib']
    NOT AVAILABLE
  
  openblas_info:
    libraries openblas not found in ['/Users/rachaelherman/venv/lib', '/usr/local/lib', '/usr/lib']
    NOT AVAILABLE
  
  atlas_3_10_blas_threads_info:
  Setting PTATLAS=ATLAS
    libraries tatlas not found in ['/Users/rachaelherman/venv/lib', '/usr/local/lib', '/usr/lib']
    NOT AVAILABLE
  
  atlas_3_10_blas_info:
    libraries satlas not found in ['/Users/rachaelherman/venv/lib', '/usr/local/lib', '/usr/lib']
    NOT AVAILABLE
  
  atlas_blas_threads_info:
  Setting PTATLAS=ATLAS
    libraries ptf77blas,ptcblas,atlas not found in ['/Users/rachaelherman/venv/lib', '/usr/local/lib', '/usr/lib']
    NOT AVAILABLE
  
  atlas_blas_info:
    libraries f77blas,cblas,atlas not found in ['/Users/rachaelherman/venv/lib', '/usr/local/lib', '/usr/lib']
    NOT AVAILABLE
  
    FOUND:
      extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
      extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
      define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
  
  non-existing path in 'numpy/distutils': 'site.cfg'
  F2PY Version 2
  lapack_opt_info:
  lapack_mkl_info:
    libraries mkl_rt not found in ['/Users/rachaelherman/venv/lib', '/usr/local/lib', '/usr/lib']
    NOT AVAILABLE
  
  openblas_lapack_info:
    libraries openblas not found in ['/Users/rachaelherman/venv/lib', '/usr/local/lib', '/usr/lib']
    NOT AVAILABLE
  
  atlas_3_10_threads_info:
  Setting PTATLAS=ATLAS
    libraries tatlas,tatlas not found in /Users/rachaelherman/venv/lib
    libraries lapack_atlas not found in /Users/rachaelherman/venv/lib
    libraries tatlas,tatlas not found in /usr/local/lib
    libraries lapack_atlas not found in /usr/local/lib
    libraries tatlas,tatlas not found in /usr/lib
    libraries lapack_atlas not found in /usr/lib
  <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
    NOT AVAILABLE
  
  atlas_3_10_info:
    libraries satlas,satlas not found in /Users/rachaelherman/venv/lib
    libraries lapack_atlas not found in /Users/rachaelherman/venv/lib
    libraries satlas,satlas not found in /usr/local/lib
    libraries lapack_atlas not found in /usr/local/lib
    libraries satlas,satlas not found in /usr/lib
    libraries lapack_atlas not found in /usr/lib
  <class 'numpy.distutils.system_info.atlas_3_10_info'>
    NOT AVAILABLE
  
  atlas_threads_info:
  Setting PTATLAS=ATLAS
    libraries ptf77blas,ptcblas,atlas not found in /Users/rachaelherman/venv/lib
    libraries lapack_atlas not found in /Users/rachaelherman/venv/lib
    libraries ptf77blas,ptcblas,atlas not found in /usr/local/lib
    libraries lapack_atlas not found in /usr/local/lib
    libraries ptf77blas,ptcblas,atlas not found in /usr/lib
    libraries lapack_atlas not found in /usr/lib
  <class 'numpy.distutils.system_info.atlas_threads_info'>
    NOT AVAILABLE
  
  atlas_info:
    libraries f77blas,cblas,atlas not found in /Users/rachaelherman/venv/lib
    libraries lapack_atlas not found in /Users/rachaelherman/venv/lib
    libraries f77blas,cblas,atlas not found in /usr/local/lib
    libraries lapack_atlas not found in /usr/local/lib
    libraries f77blas,cblas,atlas not found in /usr/lib
    libraries lapack_atlas not found in /usr/lib
  <class 'numpy.distutils.system_info.atlas_info'>
    NOT AVAILABLE
  
    FOUND:
      extra_compile_args = ['-msse3']
      extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
      define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
  
  /usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'define_macros'
    warnings.warn(msg)
  running bdist_wheel
  running build
  running config_cc
  unifing config_cc, config, build_clib, build_ext, build commands --compiler options
  running config_fc
  unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
  running build_src
  build_src
  building py_modules sources
  creating build
  creating build/src.macosx-10.13-x86_64-3.7
  creating build/src.macosx-10.13-x86_64-3.7/numpy
  creating build/src.macosx-10.13-x86_64-3.7/numpy/distutils
  building library "npymath" sources
  customize Gnu95FCompiler
  Found executable /usr/local/bin/gfortran
  customize Gnu95FCompiler
  customize Gnu95FCompiler using config
  C compiler: clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall
  
  compile options: '-Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/Users/rachaelherman/venv/include -I/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c'
  clang: _configtest.c
  clang _configtest.o -o _configtest
  success!
  removing: _configtest.c _configtest.o _configtest
  C compiler: clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall

It keeps going beyond this but I hope this is enough.

PYTHONPATH was blank in my environment so I ran PYTHONPATH=/Users/rachaelherman/venv/bin/activate
 but this did not fix the installation error.

Konrad Rudolph
  • 530,221
  • 131
  • 937
  • 1,214
  • You would have been better off leaving `PYTHONPATH` alone, and setting it to the name of a *file* is definitely incorrect. – jjramsey Jul 06 '20 at 17:26
  • BTW, is there any particular reason that you aren't using Anaconda? That would make an end run around your problems with `pip` rather than solving them, but it may be good enough. – jjramsey Jul 06 '20 at 17:32
  • 1
    I scrapped using pip to install the old versions of the packages all together and instead used conda to install all the recent versions of the packages. It worked! I can now run a python script that I was told would only work with the older versions. Thank you for the help! – Rachael Jul 06 '20 at 18:45

0 Answers0