【mac日常】mac m1安装seaborn出错、不成功,的问题解决

在Mac M1芯片的设备上,通过pip3安装seaborn时遇到错误,主要是因为numpy和其他依赖库的安装失败。官方源没有提供适配M1的版本。解决方法是先使用预发布版本的scipy源,然后再次尝试安装seaborn,最终成功安装。
摘要由CSDN通过智能技术生成

直接pip3 install seaborn出现问题:
ERROR: Command errored out with exit status 1:
command: /Library/Developer/CommandLineTools/usr/bin/python3 /private/var/folders/53/_vrnfc3x65s12bmw7g833fcc0000gn/T/pip-standalone-pip-v82a37s2/env_pip.zip/pip install --ignore-installed --no-user --prefix /private/var/folders/53/_vrnfc3x65s12bmw7g833fcc0000gn/T/pip-build-env-y6oxhgbt/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple – wheel setuptools ‘Cython>=0.29.2’ ‘numpy1.13.3; python_version’"’"‘3.5’"’"’ and platform_system!=’"’"‘AIX’"’"’’ ‘numpy1.13.3; python_version’"’"‘3.6’"’"’ and platform_system!=’"’"‘AIX’"’"’’ ‘numpy1.14.5; python_version>=’"’"‘3.7’"’"’ and platform_system!=’"’"‘AIX’"’"’’ 'numpy1.16.0; python_version==’"’"‘3.5’"’"’ and platform_system==’"’"‘AIX’"’"’’ ‘numpy1.16.0; python_version’"’"‘3.6’"’"’ and platform_system==’"’"‘AIX’"’"’’ ‘numpy1.16.0; python_version>=’"’"‘3.7’"’"’ and platform_system’"’"‘AIX’"’"’’
cwd: None
Complete output (4358 lines):
Ignoring numpy: markers ‘python_version == “3.5” and platform_system != “AIX”’ don’t match your environment
Ignoring numpy: markers ‘python_version == “3.6” and platform_system != “AIX”’ don’t match your environment
Ignoring numpy: markers ‘python_version == “3.5” and platform_system == “AIX”’ don’t match your environment
Ignoring numpy: markers ‘python_version == “3.6” and platform_system == “AIX”’ don’t match your environment
Ignoring numpy: markers ‘python_version >= “3.7” and platform_system == “AIX”’ don’t match your environment
Collecting wheel
Using cached wheel-0.37.0-py2.py3-none-any.whl (35 kB)
Collecting setuptools
Using cached setuptools-59.2.0-py3-none-any.whl (952 kB)
Collecting Cython>=0.29.2
Using cached Cython-0.29.24-py2.py3-none-any.whl (979 kB)
Collecting numpy1.14.5
Using cached numpy-1.14.5.zip (4.9 MB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status ‘done’
Building wheels for collected packages: numpy
Building wheel for numpy (setup.py): started
Building wheel for numpy (setup.py): finished with status ‘error’
ERROR: Command errored out with exit status 1:
command: /Library/Developer/CommandLineTools/usr/bin/python3 -u -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/private/var/folders/53/_vrnfc3x65s12bmw7g833fcc0000gn/T/pip-install-_vz_n89x/numpy_14d0853327624e1f9c1a4ede3d9f7a23/setup.py’"’"’; file=’"’"’/private/var/folders/53/_vrnfc3x65s12bmw7g833fcc0000gn/T/pip-install-_vz_n89x/numpy_14d0853327624e1f9c1a4ede3d9f7a23/setup.py’"’"’;f = getattr(tokenize, ‘"’"‘open’"’"’, open)(file) if os.path.exists(file) else io.StringIO(’"’"‘from setuptools import setup; setup()’"’"’);code = f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ bdist_wheel -d /private/var/folders/53/_vrnfc3x65s12bmw7g833fcc0000gn/T/pip-wheel-l3bh7xfx
cwd: /private/var/folders/53/_vrnfc3x65s12bmw7g833fcc0000gn/T/pip-install-_vz_n89x/numpy_14d0853327624e1f9c1a4ede3d9f7a23/
Complete output (4053 lines):
Running from numpy source directory.
/private/var/folders/53/_vrnfc3x65s12bmw7g833fcc0000gn/T/pip-install-_vz_n89x/numpy_14d0853327624e1f9c1a4ede3d9f7a23/numpy/distutils/misc_util.py:464: SyntaxWarning: “is” with a literal. Did you mean "
"?
return is_string(s) and (’*’ in s or ‘?’ is s)
blas_opt_info:
blas_mkl_info:
customize UnixCCompiler
libraries mkl_rt not found in [’/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib’, ‘/usr/lib’]
NOT AVAILABLE

blis_info:
customize UnixCCompiler
  libraries blis not found in ['/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib', '/usr/lib']
  NOT AVAILABLE

openblas_info:
customize UnixCCompiler
customize UnixCCompiler
  libraries openblas not found in ['/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib', '/usr/lib']
  NOT AVAILABLE

atlas_3_10_blas_threads_info:
Setting PTATLAS=ATLAS
customize UnixCCompiler
  libraries tatlas not found in ['/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib', '/usr/lib']
  NOT AVAILABLE

atlas_3_10_blas_info:
customize UnixCCompiler
  libraries satlas not found in ['/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib', '/usr/lib']
  NOT AVAILABLE

atlas_blas_threads_info:
Setting PTATLAS=ATLAS
customize UnixCCompiler
  libraries ptf77blas,ptcblas,atlas not found in ['/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib', '/usr/lib']
  NOT AVAILABLE

atlas_blas_info:
customize UnixCCompiler
  libraries f77blas,cblas,atlas not found in ['/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib', '/usr/lib']
  NOT AVAILABLE

  FOUND:
    extra_compile_args = ['-faltivec', '-I/System/Library/Frameworks/vecLib.framework/Headers']
    extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
    define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]

/bin/sh: svnversion: command not found
non-existing path in 'numpy/distutils': 'site.cfg'
/bin/sh: svnversion: command not found
F2PY Version 2
lapack_opt_info:
lapack_mkl_info:
customize UnixCCompiler
  libraries mkl_rt not found in ['/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib', '/usr/lib']
  NOT AVAILABLE

openblas_lapack_info:
customize UnixCCompiler
customize UnixCCompiler
  libraries openblas not found in ['/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib', '/usr/lib']
  NOT AVAILABLE

openblas_clapack_info:
customize UnixCCompiler
customize UnixCCompiler
  libraries openblas,lapack not found in ['/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib', '/usr/lib']
  NOT AVAILABLE

atlas_3_10_threads_info:
Setting PTATLAS=ATLAS
customize UnixCCompiler
  libraries tatlas,tatlas not found in /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib
customize UnixCCompiler
  libraries lapack_atlas not found in /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/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 /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib
customize UnixCCompiler
  libraries lapack_atlas not found in /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/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 /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib
customize UnixCCompiler
  libraries lapack_atlas not found in /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/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 /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib
customize UnixCCompiler
  libraries lapack_atlas not found in /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/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

  FOUND:
    extra_compile_args = ['-faltivec']
    extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
    define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]

/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/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.14.6-arm64-3.8
creating build/src.macosx-10.14.6-arm64-3.8/numpy
creating build/src.macosx-10.14.6-arm64-3.8/numpy/distutils
building library "npymath" sources
get_default_fcompiler: matching types: '['gnu95', 'nag', 'absoft', 'ibm', 'intel', 'gnu', 'g95', 'pg']'
customize Gnu95FCompiler
Could not locate executable gfortran
Could not locate executable f95
customize NAGFCompiler
customize AbsoftFCompiler
Could not locate executable f90
Could not locate executable f77
customize IBMFCompiler
Could not locate executable xlf90
Could not locate executable xlf
customize IntelFCompiler
Could not locate executable ifort
Could not locate executable ifc
customize GnuFCompiler
Could not locate executable g77
customize G95FCompiler
Could not locate executable g95
customize PGroupFCompiler
Could not locate executable pgfortran
don't know how to compile Fortran code on platform 'posix'
C compiler: clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration

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/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -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 -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration

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/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c'
clang: _configtest.c
_configtest.c:1:5: warning: incompatible redeclaration of library function 'exp' [-Wincompatible-library-redeclaration]
int exp (void);
    ^
_configtest.c:1:5: note: 'exp' is a builtin with type 'double (double)'
1 warning generated.
_configtest.c:1:5: warning: incompatible redeclaration of library function 'exp' [-Wincompatible-library-redeclaration]
int exp (void);
    ^
_configtest.c:1:5: note: 'exp' is a builtin with type 'double (double)'
1 warning generated.
clang _configtest.o -o _configtest
success!
removing: _configtest.c _configtest.o _configtest
creating build/src.macosx-10.14.6-arm64-3.8/n

在这里插入图片描述
仔细找是
scipy依赖库安装失败:
官网也找不到m1芯片对应的版本
https://pypi.org/project/scipy/#files

找了很久,以下解决:

pip install --pre -i https://pypi.anaconda.org/scipy-wheels-nightly/simple scipy

然后再安装seaborn

pip3 install seaborn

成功
在这里插入图片描述

评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

别出BUG求求了

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值