前提
macにpythonの環境を構築中です.scipyをinstallしたいです.
homebrewでpyenvをinstallしました.
pythonのversionは3.9.6です.
発生している問題・エラーメッセージ
pip install scipyで以下のようなエラーが出ます
Collecting scipy Using cached scipy-1.8.0.tar.gz (38.3 MB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error × Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [177 lines of output] setup.py:482: UserWarning: Unrecognized setuptools command ('dist_info --egg-base /private/var/folders/h_/8vnp2dt96s9c3g0_0k_yrty40000gn/T/pip-modern-metadata-tcry99ki'), proceeding with generating Cython sources and expanding templates warnings.warn("Unrecognized setuptools command ('{}'), proceeding with " Running from SciPy source directory. 中略 Processing scipy/stats/_boost/src/binom_ufunc.pyx Processing scipy/stats/_unuran/unuran_wrapper.pyx warning: unuran_wrapper.pyx:470:21: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line. warning: unuran_wrapper.pyx:470:28: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line. warning: unuran_wrapper.pyx:470:36: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line. warning: unuran_wrapper.pyx:515:21: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line. warning: unuran_wrapper.pyx:515:28: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line. warning: unuran_wrapper.pyx:515:36: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line. warning: unuran_wrapper.pyx:1476:21: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line. warning: unuran_wrapper.pyx:1476:28: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line. warning: unuran_wrapper.pyx:1476:36: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line. Cythonizing sources lapack_opt_info: lapack_mkl_info: customize UnixCCompiler libraries mkl_rt not found in ['/Users/username/.pyenv/versions/3.9.6/lib', '/usr/lib'] NOT AVAILABLE openblas_lapack_info: libraries openblas not found in ['/Users/username/.pyenv/versions/3.9.6/lib', '/usr/lib'] NOT AVAILABLE openblas_clapack_info: libraries openblas,lapack not found in ['/Users/username/.pyenv/versions/3.9.6/lib', '/usr/lib'] NOT AVAILABLE flame_info: libraries flame not found in ['/Users/username/.pyenv/versions/3.9.6/lib', '/usr/lib'] NOT AVAILABLE atlas_3_10_threads_info: Setting PTATLAS=ATLAS libraries lapack_atlas not found in /Users/username/.pyenv/versions/3.9.6/lib libraries tatlas,tatlas not found in /Users/username/.pyenv/versions/3.9.6/lib libraries lapack_atlas not found in /usr/lib libraries tatlas,tatlas not found in /usr/lib <class 'numpy.distutils.system_info.atlas_3_10_threads_info'> NOT AVAILABLE atlas_3_10_info: libraries lapack_atlas not found in /Users/username/.pyenv/versions/3.9.6/lib libraries satlas,satlas not found in /Users/username/.pyenv/versions/3.9.6/lib libraries lapack_atlas not found in /usr/lib libraries satlas,satlas not found in /usr/lib <class 'numpy.distutils.system_info.atlas_3_10_info'> NOT AVAILABLE atlas_threads_info: Setting PTATLAS=ATLAS libraries lapack_atlas not found in /Users/username/.pyenv/versions/3.9.6/lib libraries ptf77blas,ptcblas,atlas not found in /Users/username/.pyenv/versions/3.9.6/lib libraries lapack_atlas not found in /usr/lib libraries ptf77blas,ptcblas,atlas not found in /usr/lib <class 'numpy.distutils.system_info.atlas_threads_info'> NOT AVAILABLE atlas_info: libraries lapack_atlas not found in /Users/username/.pyenv/versions/3.9.6/lib libraries f77blas,cblas,atlas not found in /Users/username/.pyenv/versions/3.9.6/lib libraries lapack_atlas not found in /usr/lib libraries f77blas,cblas,atlas not found in /usr/lib <class 'numpy.distutils.system_info.atlas_info'> NOT AVAILABLE lapack_info: libraries lapack not found in ['/Users/username/.pyenv/versions/3.9.6/lib', '/usr/lib'] NOT AVAILABLE /private/var/folders/h_/8vnp2dt96s9c3g0_0k_yrty40000gn/T/pip-build-env-f2b9vlrj/overlay/lib/python3.9/site-packages/numpy/distutils/system_info.py:1849: 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. return getattr(self, '_calc_info_{}'.format(name))() lapack_src_info: NOT AVAILABLE /private/var/folders/h_/8vnp2dt96s9c3g0_0k_yrty40000gn/T/pip-build-env-f2b9vlrj/overlay/lib/python3.9/site-packages/numpy/distutils/system_info.py:1849: 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. return getattr(self, '_calc_info_{}'.format(name))() NOT AVAILABLE Traceback (most recent call last): File "/Users/username/.pyenv/versions/3.9.6/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module> main() File "/Users/username/.pyenv/versions/3.9.6/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main json_out['return_val'] = hook(**hook_input['kwargs']) File "/Users/username/.pyenv/versions/3.9.6/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 164, in prepare_metadata_for_build_wheel return hook(metadata_directory, config_settings) File "/private/var/folders/h_/8vnp2dt96s9c3g0_0k_yrty40000gn/T/pip-build-env-f2b9vlrj/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 174, in prepare_metadata_for_build_wheel self.run_setup() File "/private/var/folders/h_/8vnp2dt96s9c3g0_0k_yrty40000gn/T/pip-build-env-f2b9vlrj/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 267, in run_setup super(_BuildMetaLegacyBackend, File "/private/var/folders/h_/8vnp2dt96s9c3g0_0k_yrty40000gn/T/pip-build-env-f2b9vlrj/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 158, in run_setup exec(compile(code, __file__, 'exec'), locals()) File "setup.py", line 626, in <module> setup_package() File "setup.py", line 622, in setup_package setup(**metadata) File "/private/var/folders/h_/8vnp2dt96s9c3g0_0k_yrty40000gn/T/pip-build-env-f2b9vlrj/overlay/lib/python3.9/site-packages/numpy/distutils/core.py", line 135, in setup config = configuration() File "setup.py", line 522, in configuration raise NotFoundError(msg) numpy.distutils.system_info.NotFoundError: No BLAS/LAPACK libraries found. Note: Accelerate is no longer supported. To build Scipy from sources, BLAS & LAPACK libraries need to be installed. See site.cfg.example in the Scipy source directory and https://docs.scipy.org/doc/scipy/reference/building/index.html for details. [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.
試したこと
https://qiita.com/C2_now/items/c85be2ffeacd61cc7207
にあるようにbrew install scipyでも試しましたが,import 出来ませんでした.
補足情報(FW/ツールのバージョンなど)
macOS big Sur
バージョン 11.6.5
macbook air (M1, 2020)
zprofile
1eval $(/opt/homebrew/bin/brew shellenv) 2eval "$(pyenv init --path)"
zshrc
1eval "$(pyenv init -)"
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。