【错误记录】Mac 中 Python 报错 ( ERROR: Could not build wheels for numpy which use PEP 517 | 问题未解决 | 问题记录 )(一)

简介: 【错误记录】Mac 中 Python 报错 ( ERROR: Could not build wheels for numpy which use PEP 517 | 问题未解决 | 问题记录 )(一)

文章目录

一、报错信息

二、解决方案





一、报错信息


首先 , 更新 pip ; 执行如下命令 :


/usr/local/bin/python3 -m pip install --upgrade pip


执行结果 :


octopus-2:~ octopus$ /usr/local/bin/python3 -m pip install --upgrade pip
Requirement already satisfied: pip in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (21.2.3)
Collecting pip
  Downloading pip-21.2.4-py3-none-any.whl (1.6 MB)
     |████████████████████████████████| 1.6 MB 203 kB/s 
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 21.2.3
    Uninstalling pip-21.2.3:
      Successfully uninstalled pip-21.2.3
  WARNING: The scripts pip, pip3 and pip3.10 are installed in '/Library/Frameworks/Python.framework/Versions/3.10/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-21.2.4
octopus-2:~ octopus$

image.png


/usr/local/bin/python3 -m pip install numpy

image.png



octopus-2:~ octopus$ /usr/local/bin/python3 -m pip install numpy
Collecting numpy
  Using cached numpy-1.21.2.zip (10.3 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Building wheels for collected packages: numpy
  Building wheel for numpy (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/local/bin/python3 /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /var/folders/62/vmczqsnn1pq23nd3m8l20tgm0000gn/T/tmpgnwq6rfl
       cwd: /private/var/folders/62/vmczqsnn1pq23nd3m8l20tgm0000gn/T/pip-install-rwma8x2f/numpy_7b31547f15ca407ca1bc3a1f7739e891
  Complete output (152 lines):
  setup.py:63: RuntimeWarning: NumPy 1.21.2 may not yet support Python 3.10.
    warnings.warn(
  Running from numpy source directory.
  /private/var/folders/62/vmczqsnn1pq23nd3m8l20tgm0000gn/T/pip-install-rwma8x2f/numpy_7b31547f15ca407ca1bc3a1f7739e891/tools/cythonize.py:69: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
    from distutils.version import LooseVersion
  Processing numpy/random/_bounded_integers.pxd.in
  Processing numpy/random/_philox.pyx
  Processing numpy/random/_bounded_integers.pyx.in
  Processing numpy/random/_sfc64.pyx
  Processing numpy/random/_mt19937.pyx
  Processing numpy/random/bit_generator.pyx
  Processing numpy/random/mtrand.pyx
  Processing numpy/random/_generator.pyx
  Processing numpy/random/_pcg64.pyx
  Processing numpy/random/_common.pyx
  Cythonizing sources
  blas_opt_info:
  blas_mkl_info:
  customize UnixCCompiler
    libraries mkl_rt not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
    NOT AVAILABLE
  blis_info:
    libraries blis not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
    NOT AVAILABLE
  openblas_info:
    libraries openblas not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
    NOT AVAILABLE
  accelerate_info:
    libraries accelerate not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
  Library accelerate was not found. Ignoring
    libraries veclib not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
  Library veclib was not found. Ignoring
    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)]
    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'
  lapack_opt_info:
  lapack_mkl_info:
    libraries mkl_rt not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
    NOT AVAILABLE
  openblas_lapack_info:
    libraries openblas not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
    NOT AVAILABLE
  openblas_clapack_info:
    libraries openblas,lapack not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
    NOT AVAILABLE
  flame_info:
    libraries flame not found in ['/Library/Frameworks/Python.framework/Versions/3.10/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)]
  Warning: attempted relative import with no known parent package
  /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/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.9-universal2-3.10
  creating build/src.macosx-10.9-universal2-3.10/numpy
  creating build/src.macosx-10.9-universal2-3.10/numpy/distutils
  building library "npymath" sources
  Could not locate executable gfortran
  Could not locate executable f95
  Could not locate executable f90
  Could not locate executable f77
  Could not locate executable xlf90
  Could not locate executable xlf
  Could not locate executable ifort
  Could not locate executable ifc
  Could not locate executable g77
  Could not locate executable g95
  Could not locate executable pgfortran
  don't know how to compile Fortran code on platform 'posix'
  xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  Traceback (most recent call last):
    File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 349, in <module>
      main()
    File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 331, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 248, in build_wheel
      return _build_backend().build_wheel(wheel_directory, config_settings,
    File "/private/var/folders/62/vmczqsnn1pq23nd3m8l20tgm0000gn/T/pip-build-env-hb313o5v/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 211, in build_wheel
      return self._build_with_temp_dir(['bdist_wheel'], '.whl',
    File "/private/var/folders/62/vmczqsnn1pq23nd3m8l20tgm0000gn/T/pip-build-env-hb313o5v/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 197, in _build_with_temp_dir
      self.run_setup()
    File "/private/var/folders/62/vmczqsnn1pq23nd3m8l20tgm0000gn/T/pip-build-env-hb313o5v/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 248, in run_setup
      super(_BuildMetaLegacyBackend,
    File "/private/var/folders/62/vmczqsnn1pq23nd3m8l20tgm0000gn/T/pip-build-env-hb313o5v/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 142, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 448, in <module>
      setup_package()
    File "setup.py", line 440, in setup_package
      setup(**metadata)
    File "/private/var/folders/62/vmczqsnn1pq23nd3m8l20tgm0000gn/T/pip-install-rwma8x2f/numpy_7b31547f15ca407ca1bc3a1f7739e891/numpy/distutils/core.py", line 169, in setup
      return old_setup(**new_attr)
    File "/private/var/folders/62/vmczqsnn1pq23nd3m8l20tgm0000gn/T/pip-build-env-hb313o5v/overlay/lib/python3.10/site-packages/setuptools/__init__.py", line 165, in setup
      return distutils.core.setup(**attrs)
    File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/private/var/folders/62/vmczqsnn1pq23nd3m8l20tgm0000gn/T/pip-build-env-hb313o5v/overlay/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 299, in run
      self.run_command('build')
    File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/private/var/folders/62/vmczqsnn1pq23nd3m8l20tgm0000gn/T/pip-install-rwma8x2f/numpy_7b31547f15ca407ca1bc3a1f7739e891/numpy/distutils/command/build.py", line 61, in run
      old_build.run(self)
    File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/private/var/folders/62/vmczqsnn1pq23nd3m8l20tgm0000gn/T/pip-install-rwma8x2f/numpy_7b31547f15ca407ca1bc3a1f7739e891/numpy/distutils/command/build_src.py", line 144, in run
      self.build_sources()
    File "/private/var/folders/62/vmczqsnn1pq23nd3m8l20tgm0000gn/T/pip-install-rwma8x2f/numpy_7b31547f15ca407ca1bc3a1f7739e891/numpy/distutils/command/build_src.py", line 155, in build_sources
      self.build_library_sources(*libname_info)
    File "/private/var/folders/62/vmczqsnn1pq23nd3m8l20tgm0000gn/T/pip-install-rwma8x2f/numpy_7b31547f15ca407ca1bc3a1f7739e891/numpy/distutils/command/build_src.py", line 288, in build_library_sources
      sources = self.generate_sources(sources, (lib_name, build_info))
    File "/private/var/folders/62/vmczqsnn1pq23nd3m8l20tgm0000gn/T/pip-install-rwma8x2f/numpy_7b31547f15ca407ca1bc3a1f7739e891/numpy/distutils/command/build_src.py", line 378, in generate_sources
      source = func(extension, build_dir)
    File "numpy/core/setup.py", line 666, in get_mathlib_info
      raise RuntimeError("Broken toolchain: cannot link a simple C program")
  RuntimeError: Broken toolchain: cannot link a simple C program
  ----------------------------------------
  ERROR: Failed building wheel for numpy
Failed to build numpy
ERROR: Could not build wheels for numpy which use PEP 517 and cannot be installed directly
octopus-2:~ octopus$







二、解决方案


该错误只在 Mac 中存在 , 在 Windows 中可以正常运行 ;


Mac 上没有解决 ;


在此处做个记录 , 之后遇到再解决 ;


目录
相关文章
|
23天前
|
Linux 数据库管理 Python
CentOS7编译安装Python3.10(含OpenSSL1.1.1安装),创建虚拟环境,运行Django项目(含sqlite版本报错)
CentOS7编译安装Python3.10(含OpenSSL1.1.1安装),创建虚拟环境,运行Django项目(含sqlite版本报错)
136 4
|
21天前
|
Java Serverless 应用服务中间件
Serverless 应用引擎操作报错合集之部署python项目时,构建过程报错,怎么解决
Serverless 应用引擎(SAE)是阿里云提供的Serverless PaaS平台,支持Spring Cloud、Dubbo、HSF等主流微服务框架,简化应用的部署、运维和弹性伸缩。在使用SAE过程中,可能会遇到各种操作报错。以下是一些常见的报错情况及其可能的原因和解决方法。
|
3天前
|
监控 Serverless Docker
函数计算操作报错合集之遇到报错:Python Jedi client: couldn't create connection to server.是什么原因
在使用函数计算服务(如阿里云函数计算)时,用户可能会遇到多种错误场景。以下是一些常见的操作报错及其可能的原因和解决方法,包括但不限于:1. 函数部署失败、2. 函数执行超时、3. 资源不足错误、4. 权限与访问错误、5. 依赖问题、6. 网络配置错误、7. 触发器配置错误、8. 日志与监控问题。
|
7天前
|
搜索推荐 Python Windows
python中对于wordcloud词云生成报错提示的解决
通过搜索印象错误信息:ValueError:Only supported for TrueType fonts,几乎大部分人给出的选项都是让你指定TrueType fonts路径,或者新下载TTF字体,并重新指定,但是这两种解决方案并无法解决报错。 在真正解决问题之前,先来介绍几个与之相关的知识点,对于有经验的人,这样的知识点完全是“小菜”,但是对于初学者,这种知识点就是因为缺少相关实践而无从下手,无从搜索引擎。
|
12天前
|
Python
【Python3报错】Fatal error in launcher: Unable to create process using ……
【Python3报错】Fatal error in launcher: Unable to create process using ……
|
3天前
|
消息中间件 监控 Serverless
函数计算操作报错合集之显示报错:RecursionError: maximum recursion depth exceeded while calling a Python object,该如何解决
在使用函数计算服务(如阿里云函数计算)时,用户可能会遇到多种错误场景。以下是一些常见的操作报错及其可能的原因和解决方法,包括但不限于:1. 函数部署失败、2. 函数执行超时、3. 资源不足错误、4. 权限与访问错误、5. 依赖问题、6. 网络配置错误、7. 触发器配置错误、8. 日志与监控问题。
|
8天前
|
分布式计算 DataWorks 大数据
MaxCompute操作报错合集之pyODPS导入python包的时候报错,该怎么办
MaxCompute是阿里云提供的大规模离线数据处理服务,用于大数据分析、挖掘和报表生成等场景。在使用MaxCompute进行数据处理时,可能会遇到各种操作报错。以下是一些常见的MaxCompute操作报错及其可能的原因与解决措施的合集。
|
20天前
|
机器学习/深度学习 人工智能 IDE
人工智能平台PAI操作报错合集之交互式建模(DSW)环境中,numpy模块如何正确安装
阿里云人工智能平台PAI (Platform for Artificial Intelligence) 是阿里云推出的一套全面、易用的机器学习和深度学习平台,旨在帮助企业、开发者和数据科学家快速构建、训练、部署和管理人工智能模型。在使用阿里云人工智能平台PAI进行操作时,可能会遇到各种类型的错误。以下列举了一些常见的报错情况及其可能的原因和解决方法。
|
24天前
|
应用服务中间件 开发工具 nginx
Mac M1/M2/M3 芯片环境配置以及常用软件安装-前端
Mac M1/M2/M3 芯片环境配置以及常用软件安装-前端 最近换了台新 Mac,所有的配置和软件就重新安装下,顺便写个文章。
72 1
|
26天前
|
应用服务中间件 Shell nginx
mac m1笔记本docker 安装nginx
mac m1笔记本docker 安装nginx
76 4