argkh
argkh

Reputation: 21

What's wrong with installing scipy via pip, py39 under FreeBSD 13.1?

I'm triyng to install scipy via pip in an virtual environment but it ends with an error. $ uname -a FreeBSD BSD-13 13.1-RELEASE-p3 FreeBSD 13.1-RELEASE-p3 GENERIC amd64

Venv is with python 3.9

What I do: (env)$ pip install scipy

What I get: ` note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed

× Encountered error while generating package metadata. ╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.`

From output:

 (env) $ pip install scipy                                                                                                                                 
  error: subprocess-exited-with-error                                                                                                                                                                       
                                                                                                                                                                                            
  × Preparing metadata (pyproject.toml) did not run successfully.                                                                                                                                           
  │ exit code: 1                                                                                                                                                                                             
  ╰─> [1115 lines of output]                                                                                                                                                                                
      The Meson build system    
      Version: 1.1.1                                                                                                                                                                                         
      Source dir: /tmp/pip-install-5z2e6tci/scipy_ad2046d2ded14815af222ec7dbe3dd66                                                                                                                           
      Build dir: /tmp/pip-install-5z2e6tci/scipy_ad2046d2ded14815af222ec7dbe3dd66/.mesonpy-rx7e0be7/build                                                                                                    
      Build type: native build                                                                                                                                                                               
      Project name: SciPy                                                                                                                                                                                    
      Project version: 1.10.1                                                                                                                                                                                
      C compiler for the host machine: cc (clang 13.0.0 "FreeBSD clang version 13.0.0 ([email protected]:llvm/llvm-project.git llvmorg-13.0.0-0-gd7b669b3a303)")                                                
      C linker for the host machine: cc ld.lld 13.0.0                                                                                                                                                        
      C++ compiler for the host machine: c++ (clang 13.0.0 "FreeBSD clang version 13.0.0 ([email protected]:llvm/llvm-project.git llvmorg-13.0.0-0-gd7b669b3a303)")                                             
      C++ linker for the host machine: c++ ld.lld 13.0.0                                                                                                                                                     
      Cython compiler for the host machine: cython (cython 0.29.35)                                                                                                                                          
      Host machine cpu family: x86_64                                                                                                                                                                        
      Host machine cpu: x86_64                                                                                                                                                                               
      Compiler for C supports arguments -Wno-unused-but-set-variable: YES                                                                                                                                    
      Compiler for C supports arguments -Wno-unused-function: YES                                                                                                                                            
      Compiler for C supports arguments -Wno-conversion: YES                                                                                                                                                 
      Compiler for C supports arguments -Wno-misleading-indentation: YES                                                                                                                                     
      Compiler for C supports arguments -Wno-incompatible-pointer-types: YES                                                                                                                                 
      Library m found: YES                                                                                                                                                                                   
      Fortran compiler for the host machine: gfortran (gcc 12.2.0 "GNU Fortran (FreeBSD Ports Collection) 12.2.0")                                                                                           
      Fortran linker for the host machine: gfortran ld.bfd 2.40                                                                                                                                              
      Compiler for Fortran supports arguments -Wno-conversion: YES                                                                                                                                           
      Checking if "-Wl,--version-script" : links: YES                                                                                                                                                        
      Program cython found: YES (/tmp/pip-build-env-cfphp0hs/overlay/bin/cython)                                                                                                                             
      Program python found: YES (/usr/home/argkh/PyVenv/env/bin/python3)                                                                                                                                     
      Found pkg-config: /usr/local/bin/pkg-config (1.8.1)                                                                                                                                                    
      Program pythran found: YES (/tmp/pip-build-env-cfphp0hs/overlay/bin/pythran)                                                                                                                           
      Run-time dependency threads found: YES                                                                                                                                                                 
      Library npymath found: YES                                                                                                                                                                             
      Library npyrandom found: YES                                                                                                                                                                           
      Run-time dependency openblas found: YES 0.3.20                                                                                                                                                         
      Dependency openblas found: YES 0.3.20 (cached)                                                                                                                                                         
      Compiler for C supports arguments -Wno-maybe-uninitialized: NO                                                                                                                                         
      Compiler for C supports arguments -Wno-discarded-qualifiers: NO                                                                                                                                        
      Compiler for C supports arguments -Wno-empty-body: YES                                                                                                                                                 
      Compiler for C supports arguments -Wno-implicit-function-declaration: YES                                                                                                                              
      Compiler for C supports arguments -Wno-parentheses: YES                                                                                                                                                
      Compiler for C supports arguments -Wno-switch: YES                                                                                                                                                     
      Compiler for C supports arguments -Wno-unused-label: YES                                                                                                                                               
      Compiler for C supports arguments -Wno-unused-variable: YES                                                                                                                                            
      Compiler for C++ supports arguments -Wno-cpp: YES                                                                                                                                                      
      Compiler for C++ supports arguments -Wno-deprecated-declarations: YES                                                                                                                                  
      Compiler for C++ supports arguments -Wno-class-memaccess: NO                                                                                                                                           
      Compiler for C++ supports arguments -Wno-format-truncation: NO                                                                                                                                         
      Compiler for C++ supports arguments -Wno-non-virtual-dtor: YES                                                                                                                                         
      Compiler for C++ supports arguments -Wno-sign-compare: YES                                                                                                                                             
      Compiler for C++ supports arguments -Wno-switch: YES                                                                                                                                                   
      Compiler for C++ supports arguments -Wno-terminate: NO                                                                                                                                                 
      Compiler for C++ supports arguments -Wno-unused-but-set-variable: YES                                                                                                                                  
      Compiler for C++ supports arguments -Wno-unused-function: YES     
      Compiler for C++ supports arguments -Wno-unused-local-typedefs: YES                                                                                                                                    
      Compiler for C++ supports arguments -Wno-unused-variable: YES                                                                                                                                          
      Compiler for C++ supports arguments -Wno-int-in-bool-context: YES                                                                                                                                      
      Compiler for Fortran supports arguments -Wno-argument-mismatch: YES                                                                                                                                    
      Compiler for Fortran supports arguments -Wno-conversion: YES (cached)                                                                                                                                  
      Compiler for Fortran supports arguments -Wno-intrinsic-shadow: YES                                                                                                                                     
      Compiler for Fortran supports arguments -Wno-maybe-uninitialized: YES                                                                                                                                  
      Compiler for Fortran supports arguments -Wno-surprising: YES                                                                                                                                           
      Compiler for Fortran supports arguments -Wno-uninitialized: YES                                                                                                                                        
      Compiler for Fortran supports arguments -Wno-unused-dummy-argument: YES                                                                                                                                
      Compiler for Fortran supports arguments -Wno-unused-label: YES                                                                                                                                         
      Compiler for Fortran supports arguments -Wno-unused-variable: YES                                                                                                                                      
      Compiler for Fortran supports arguments -Wno-tabs: YES                                                                                                                                                 
      Compiler for Fortran supports arguments -Wno-argument-mismatch: YES (cached)                                                                                                                           
      Compiler for Fortran supports arguments -Wno-conversion: YES (cached)                                                                                                                                  
      Compiler for Fortran supports arguments -Wno-maybe-uninitialized: YES (cached)                                                                                                                         
      Compiler for Fortran supports arguments -Wno-unused-dummy-argument: YES (cached)                                                                                                                       
      Compiler for Fortran supports arguments -Wno-unused-label: YES (cached)                                                                                                                                
      Compiler for Fortran supports arguments -Wno-unused-variable: YES (cached)                                                                                                                             
      Compiler for Fortran supports arguments -Wno-tabs: YES (cached)                                                                                                                                        
      Checking if "Check atomic builtins without -latomic" : links: YES                                                                                                                                      
      Configuring __config__.py using configuration                                                                                                                                                          
      Checking for function "open_memstream" : YES                                                                                                                                                           
      Configuring messagestream_config.h using configuration                                                                                                                                                 
      Compiler for Fortran supports arguments -w: YES                                                                                                                                                        
      Checking for size of "void*" : 8                                                                                                                                                                       
      Compiler for C supports arguments -Wno-unused-variable: YES (cached)                                                                                                                                   
      Compiler for C supports arguments -Wno-parentheses: YES (cached)                                                                                                                                       
      Compiler for C supports arguments -Wno-unused-label: YES (cached)                                                                                                                                      
      Compiler for C supports arguments -Wno-implicit-function-declaration: YES (cached)                                                                                                                     
      Compiler for C supports arguments -Wno-switch: YES (cached)                                                                                                                                            
      Compiler for Fortran supports arguments -w: YES (cached)                                                                                                                                               
      Checking for size of "void*" : 8 (cached)                                                                                                                                                              
      Build targets in project: 252                                                                                                                                                                          
      NOTICE: Future-deprecated features used:                                                                                                                                                               
       * 1.1.0: {'"boolean option" keyword argument "value" of type str'}                                                                                                                                    
                                                                                                                                                                                                            
      SciPy 1.10.1                                                                                                                                                                                           
                                                                                                                                                                                                            
        User defined options                                                                                                                                                                                 
          Native files: /tmp/pip-install-5z2e6tci/scipy_ad2046d2ded14815af222ec7dbe3dd66/.mesonpy-native-file.ini                                                                                            
          debug       : false                                                                                                                                                                                
          optimization: 2                                                                                                                                                                                    
          prefix      : /usr/local                                                                                                                                                                           
                                                                                                                                                                                                            
      Found ninja-1.11.1.git.kitware.jobserver-1 at /tmp/pip-build-env-cfphp0hs/normal/bin/ninja                                                                                                             
     
......................................................

      [819/1619] Linking target scipy/stats/_qmc_cy.cpython-39.so                                                                                                                                            
      [820/1619] Compiling C++ object scipy/stats/_stats_pythran.cpython-39.so.p/meson-generated_..__stats_pythran.cpp.o                                                                                     
      FAILED: scipy/stats/_stats_pythran.cpython-39.so.p/meson-generated_..__stats_pythran.cpp.o                                                                                                             
      c++ -Iscipy/stats/_stats_pythran.cpython-39.so.p -Iscipy/stats -I../../scipy/stats -I/tmp/pip-build-env-cfphp0hs/overlay/lib/python3.9/site-packages/pythran -I/tmp/pip-buil                           d-env-cfphp0hs/overlay/lib/python3.9/site-packages/numpy/core/include -I/usr/local/include/python3.9 -fvisibility=hidden -fvisibility-inlines-hidden -fcolor-diagnostics -D_FILE_O
FFSET_BITS=64 -Wall -Winvalid-pch -std=c++14 -O2 -fPIC -DENABLE_PYTHON_MODULE -D__PYTHRAN__=3 -DPYTHRAN_BLAS_NONE -Wno-cpp -Wno-deprecated-declarations -Wno-unused-but-set-variable -Wno-unused-function -Wno-unused-variable -Wno-int-in-bool-context -MD -MQ scipy/stats/_stats_pythran.cpython-39.so.p/meson-generated_..__stats_pythran.cpp.o -MF scipy/stats/_stats_pythran.cpython-39.so.p/meson-generated_..__stats_pythran.cpp.o.d -o scipy/stats/_stats_pythran.cpython-39.so.p/meson-generated_..__stats_pythran.cpp.o -c scipy/stats/_stats_pythran.cpp
      In file included from scipy/stats/_stats_pythran.cpp:34:
      In file included from /tmp/pip-build-env-cfphp0hs/overlay/lib/python3.9/site-packages/pythran/pythonic/include/numpy/ceil.hpp:8:
      In file included from /tmp/pip-build-env-cfphp0hs/overlay/lib/python3.9/site-packages/pythran/xsimd/xsimd.hpp:55:
      /tmp/pip-build-env-cfphp0hs/overlay/lib/python3.9/site-packages/pythran/xsimd/arch/xsimd_scalar.hpp:447:16: error: no member named 'exp10f' in the global namespace; did you mean 'exp10'?
              return ::exp10f(x);
                     ^~~~~~~~
                     exp10
      /tmp/pip-build-env-cfphp0hs/overlay/lib/python3.9/site-packages/pythran/xsimd/arch/xsimd_scalar.hpp:445:18: note: 'exp10' declared here
          inline float exp10(const float& x) noexcept
                       ^
      /tmp/pip-build-env-cfphp0hs/overlay/lib/python3.9/site-packages/pythran/xsimd/arch/xsimd_scalar.hpp:451:16: error: no member named 'exp10' in the global namespace; did you mean simply 'exp10'?
              return ::exp10(x);
                     ^~~~~~~
                     exp10
      /tmp/pip-build-env-cfphp0hs/overlay/lib/python3.9/site-packages/pythran/xsimd/arch/xsimd_scalar.hpp:449:19: note: 'exp10' declared here
          inline double exp10(const double& x) noexcept
                        ^
      2 errors generated.
      [821/1619] Generating 'scipy/stats/_boost/binom_ufunc.cpython-39.so.p/binom_ufunc.cpp'.
      [822/1619] Compiling C object scipy/stats/_sobol.cpython-39.so.p/meson-generated__sobol.c.o
      [823/1619] Compiling C object scipy/stats/_stats.cpython-39.so.p/meson-generated__stats.c.o
      [824/1619] Compiling C++ object scipy/sparse/sparsetools/_sparsetools.cpython-39.so.p/csr.cxx.o
      [825/1619] Compiling C++ object scipy/sparse/sparsetools/_sparsetools.cpython-39.so.p/bsr.cxx.o
      ninja: build stopped: subcommand failed.
      INFO: autodetecting backend as ninja
      INFO: calculating backend command to run: /tmp/pip-build-env-cfphp0hs/normal/bin/ninja
      + meson setup --prefix=/usr/local /tmp/pip-install-5z2e6tci/scipy_ad2046d2ded14815af222ec7dbe3dd66 /tmp/pip-install-5z2e6tci/scipy_ad2046d2ded14815af222ec7dbe3dd66/.mesonpy-rx7e0be7/build --native-file=/tmp/pip-install-5z2e6tci/scipy_ad2046d2ded14815af222ec7dbe3dd66/.mesonpy-native-file.ini -Ddebug=false -Doptimization=2
      + meson compile
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details

Upvotes: 0

Views: 674

Answers (1)

Valery S.
Valery S.

Reputation: 636

Like it is said here:

In file included from /tmp/pip-build-env-cfphp0hs/overlay/lib/python3.9/site-packages/pythran/xsimd/xsimd.hpp:55:
      /tmp/pip-build-env-cfphp0hs/overlay/lib/python3.9/site-packages/pythran/xsimd/arch/xsimd_scalar.hpp:447:16: error: no member named 'exp10f' in the global namespace; did you mean 'exp10'?
              return ::exp10f(x);
                     ^~~~~~~~
                     exp10

::exp10f is not found ; so, it is related to pythran, which is required by scipy ; this bug has a workaround here : FreeBSD-13.1-pythran-issues-2070

Or you could try to install it through the ports collection in science/py-scipy, which is better than pip because any bug found have their patches already. What you get with pip is compiling from the the source tree which could lead to some bug because it is generally made (or designed) under Linux.

Upvotes: 2

Related Questions