macOS Monterey -安装Scipy错误“未找到lapack/lappack资源”

h6my8fg2  于 2023-10-20  发布在  Mac
关注(0)|答案(2)|浏览(147)

我在Mac上使用brew install pyenv安装了pyenv。我想运行一个需要安装scipy==1.5.4的python项目。我尝试使用命令pip3 install scipy==1.5.4安装它,但我得到了一个错误No lapack/blas resources found
为了解决这个问题,我运行了错误和其他解决方案中建议的以下命令。
brew install openblas
随后是:

export LDFLAGS="-L/usr/local/opt/openblas/lib"
export CPPFLAGS="-I/usr/local/opt/openblas/include"
export PKG_CONFIG_PATH="/usr/local/opt/openblas/lib/pkgconfig"

接下来我做了

brew install lapack

其次是

export LDFLAGS="-L/usr/local/opt/lapack/lib"
export CPPFLAGS="-I/usr/local/opt/lapack/include"
export PKG_CONFIG_PATH="/usr/local/opt/lapack/lib/pkgconfig"

现在我已经安装了blaslapack,我希望错误消失,但我仍然面临类似的错误。我该如何解决这个问题?
PS

完全错误

Running from SciPy source directory.
    lapack_opt_info:
    lapack_mkl_info:
    customize UnixCCompiler
      libraries mkl_rt not found in ['/Users/furqan/.pyenv/versions/3.6.13/envs/venv/lib', '/usr/local/lib', '/usr/lib']
      NOT AVAILABLE
    
    openblas_lapack_info:
    customize UnixCCompiler
    customize UnixCCompiler
      libraries openblas not found in ['/Users/furqan/.pyenv/versions/3.6.13/envs/venv/lib', '/usr/local/lib', '/usr/lib']
      NOT AVAILABLE
    
    openblas_clapack_info:
    customize UnixCCompiler
    customize UnixCCompiler
      libraries openblas,lapack not found in ['/Users/furqan/.pyenv/versions/3.6.13/envs/venv/lib', '/usr/local/lib', '/usr/lib']
      NOT AVAILABLE
    
    atlas_3_10_threads_info:
    Setting PTATLAS=ATLAS
    customize UnixCCompiler
      libraries tatlas,tatlas not found in /Users/furqan/.pyenv/versions/3.6.13/envs/venv/lib
    customize UnixCCompiler
      libraries lapack_atlas not found in /Users/furqan/.pyenv/versions/3.6.13/envs/venv/lib
    customize UnixCCompiler
      libraries tatlas,tatlas not found in /usr/local/lib
    customize UnixCCompiler
      libraries lapack_atlas not found in /usr/local/lib
    customize UnixCCompiler
      libraries tatlas,tatlas not found in /usr/lib
    customize UnixCCompiler
      libraries lapack_atlas not found in /usr/lib
    <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
      NOT AVAILABLE
    
    atlas_3_10_info:
    customize UnixCCompiler
      libraries satlas,satlas not found in /Users/furqan/.pyenv/versions/3.6.13/envs/venv/lib
    customize UnixCCompiler
      libraries lapack_atlas not found in /Users/furqan/.pyenv/versions/3.6.13/envs/venv/lib
    customize UnixCCompiler
      libraries satlas,satlas not found in /usr/local/lib
    customize UnixCCompiler
      libraries lapack_atlas not found in /usr/local/lib
    customize UnixCCompiler
      libraries satlas,satlas not found in /usr/lib
    customize UnixCCompiler
      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
    customize UnixCCompiler
      libraries ptf77blas,ptcblas,atlas not found in /Users/furqan/.pyenv/versions/3.6.13/envs/venv/lib
    customize UnixCCompiler
      libraries lapack_atlas not found in /Users/furqan/.pyenv/versions/3.6.13/envs/venv/lib
    customize UnixCCompiler
      libraries ptf77blas,ptcblas,atlas not found in /usr/local/lib
    customize UnixCCompiler
      libraries lapack_atlas not found in /usr/local/lib
    customize UnixCCompiler
      libraries ptf77blas,ptcblas,atlas not found in /usr/lib
    customize UnixCCompiler
      libraries lapack_atlas not found in /usr/lib
    <class 'numpy.distutils.system_info.atlas_threads_info'>
      NOT AVAILABLE
    
    atlas_info:
    customize UnixCCompiler
      libraries f77blas,cblas,atlas not found in /Users/furqan/.pyenv/versions/3.6.13/envs/venv/lib
    customize UnixCCompiler
      libraries lapack_atlas not found in /Users/furqan/.pyenv/versions/3.6.13/envs/venv/lib
    customize UnixCCompiler
      libraries f77blas,cblas,atlas not found in /usr/local/lib
    customize UnixCCompiler
      libraries lapack_atlas not found in /usr/local/lib
    customize UnixCCompiler
      libraries f77blas,cblas,atlas not found in /usr/lib
    customize UnixCCompiler
      libraries lapack_atlas not found in /usr/lib
    <class 'numpy.distutils.system_info.atlas_info'>
      NOT AVAILABLE
    
    /private/var/folders/8p/qhqd9mgj7n93g_6snx_4y9rh0000gn/T/pip-build-env-n8dln98w/lib/python3.6/site-packages/numpy/distutils/system_info.py:624: UserWarning:
        Atlas (http://math-atlas.sourceforge.net/) libraries not found.
        Directories to search for the libraries can be specified in the
        numpy/distutils/site.cfg file (section [atlas]) or by setting
        the ATLAS environment variable.
      self.calc_info()
    lapack_info:
    customize UnixCCompiler
      libraries lapack not found in ['/Users/furqan/.pyenv/versions/3.6.13/envs/venv/lib', '/usr/local/lib', '/usr/lib']
      NOT AVAILABLE
    
    /private/var/folders/8p/qhqd9mgj7n93g_6snx_4y9rh0000gn/T/pip-build-env-n8dln98w/lib/python3.6/site-packages/numpy/distutils/system_info.py:624: UserWarning:
        Lapack (http://www.netlib.org/lapack/) libraries not found.
        Directories to search for the libraries can be specified in the
        numpy/distutils/site.cfg file (section [lapack]) or by setting
        the LAPACK environment variable.
      self.calc_info()
    lapack_src_info:
      NOT AVAILABLE
    
    /private/var/folders/8p/qhqd9mgj7n93g_6snx_4y9rh0000gn/T/pip-build-env-n8dln98w/lib/python3.6/site-packages/numpy/distutils/system_info.py:624: UserWarning:
        Lapack (http://www.netlib.org/lapack/) sources not found.
        Directories to search for the sources can be specified in the
        numpy/distutils/site.cfg file (section [lapack_src]) or by setting
        the LAPACK_SRC environment variable.
      self.calc_info()
      NOT AVAILABLE
    
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/8p/qhqd9mgj7n93g_6snx_4y9rh0000gn/T/pip-install-x19xcozn/scipy/setup.py", line 583, in <module>
        setup_package()
      File "/private/var/folders/8p/qhqd9mgj7n93g_6snx_4y9rh0000gn/T/pip-install-x19xcozn/scipy/setup.py", line 579, in setup_package
        setup(**metadata)
      File "/private/var/folders/8p/qhqd9mgj7n93g_6snx_4y9rh0000gn/T/pip-build-env-n8dln98w/lib/python3.6/site-packages/numpy/distutils/core.py", line 135, in setup
        config = configuration()
      File "/private/var/folders/8p/qhqd9mgj7n93g_6snx_4y9rh0000gn/T/pip-install-x19xcozn/scipy/setup.py", line 477, in configuration
        raise NotFoundError(msg)
    numpy.distutils.system_info.NotFoundError: No lapack/blas resources found. Note: Accelerate is no longer supported.
    
    ----------------------------------------
Command "/Users/furqan/.pyenv/versions/3.6.13/envs/venv/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/8p/qhqd9mgj7n93g_6snx_4y9rh0000gn/T/pip-install-x19xcozn/scipy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/8p/qhqd9mgj7n93g_6snx_4y9rh0000gn/T/pip-record-uy6kggfm/install-record.txt --single-version-externally-managed --compile --install-headers /Users/furqan/.pyenv/versions/3.6.13/envs/venv/include/site/python3.6/scipy" failed with error code 1 in /private/var/folders/8p/qhqd9mgj7n93g_6snx_4y9rh0000gn/T/pip-install-x19xcozn/scipy/
mv1qrgav

mv1qrgav1#

我们在升级Django应用程序以使用Python 3.8时遇到了类似的问题。我们的解决方案来自这个github线程。我们在Big Sur上运行,所以不确定相同的修复程序是否适用于您,但在您运行软件包安装之前,请运行export SYSTEM_VERSION_COMPAT=1。同样,不确定这是否会在您的环境中解决,但它对我们有效。

yquaqz18

yquaqz182#

我现在正在使用MacBookAir(M1 2020),这个命令对我很有效:

export SYSTEM_VERSION_COMPAT=1

相关问题