文章目录

  • 一、报错信息
  • 二、解决方案

一、报错信息


编译时 , 报错如下信息 :

No module named ‘numpy‘

二、解决方案


pip install numpy
Try to run this command from the system terminal.
Make sure that you use the correct version of 'pip' installed for your Python interpreter located at '/usr/local/bin/python3'.
Collecting numpyUsing cached numpy-1.21.2.zip (10.3 MB)Installing build dependencies: startedInstalling build dependencies: finished with status 'done'Getting requirements to build wheel: startedGetting requirements to build wheel: finished with status 'done'Preparing wheel metadata: startedPreparing wheel metadata: finished with status 'done'
Building wheels for collected packages: numpyBuilding wheel for numpy (PEP 517): startedBuilding wheel for numpy (PEP 517): finished with status 'error'
Failed to build numpyERROR: 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/tmp1nsvz_z3cwd: /private/var/folders/62/vmczqsnn1pq23nd3m8l20tgm0000gn/T/pip-install-9_bhqerr/numpy_280faa88bab24eab97533beae7f5be03Complete 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.Cythonizing sourcesProcessing numpy/random/_bounded_integers.pxd.inProcessing numpy/random/_philox.pyx/private/var/folders/62/vmczqsnn1pq23nd3m8l20tgm0000gn/T/pip-install-9_bhqerr/numpy_280faa88bab24eab97533beae7f5be03/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 alternativesfrom distutils.version import LooseVersionProcessing numpy/random/_bounded_integers.pyx.inProcessing numpy/random/_sfc64.pyxProcessing numpy/random/_mt19937.pyxProcessing numpy/random/bit_generator.pyxProcessing numpy/random/mtrand.pyxProcessing numpy/random/_generator.pyxProcessing numpy/random/_pcg64.pyxProcessing numpy/random/_common.pyxblas_opt_info:blas_mkl_info:customize UnixCCompilerlibraries mkl_rt not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']NOT AVAILABLEblis_info:libraries blis not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']NOT AVAILABLEopenblas_info:libraries openblas not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']NOT AVAILABLEaccelerate_info:libraries accelerate not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']Library accelerate was not found. Ignoringlibraries veclib not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']Library veclib was not found. IgnoringFOUND: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 AVAILABLEopenblas_lapack_info:libraries openblas not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']NOT AVAILABLEopenblas_clapack_info:libraries openblas,lapack not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']NOT AVAILABLEflame_info:libraries flame not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']NOT AVAILABLEFOUND: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_wheelrunning buildrunning config_ccunifing config_cc, config, build_clib, build_ext, build commands --compiler optionsrunning config_fcunifing config_fc, config, build_clib, build_ext, build commands --fcompiler optionsrunning build_srcbuild_srcbuilding py_modules sourcescreating buildcreating build/src.macosx-10.9-universal2-3.10creating build/src.macosx-10.9-universal2-3.10/numpycreating build/src.macosx-10.9-universal2-3.10/numpy/distutilsbuilding library "npymath" sourcesCould not locate executable gfortranCould not locate executable f95Could not locate executable f90Could not locate executable f77Could not locate executable xlf90Could not locate executable xlfCould not locate executable ifortCould not locate executable ifcCould not locate executable g77Could not locate executable g95Could not locate executable pgfortrandon'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/xcrunTraceback (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 mainjson_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_wheelreturn _build_backend().build_wheel(wheel_directory, config_settings,File "/private/var/folders/62/vmczqsnn1pq23nd3m8l20tgm0000gn/T/pip-build-env-r0ly8_th/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 211, in build_wheelreturn self._build_with_temp_dir(['bdist_wheel'], '.whl',File "/private/var/folders/62/vmczqsnn1pq23nd3m8l20tgm0000gn/T/pip-build-env-r0ly8_th/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 197, in _build_with_temp_dirself.run_setup()File "/private/var/folders/62/vmczqsnn1pq23nd3m8l20tgm0000gn/T/pip-build-env-r0ly8_th/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 248, in run_setupsuper(_BuildMetaLegacyBackend,File "/private/var/folders/62/vmczqsnn1pq23nd3m8l20tgm0000gn/T/pip-build-env-r0ly8_th/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 142, in run_setupexec(compile(code, __file__, 'exec'), locals())File "setup.py", line 448, in <module>setup_package()File "setup.py", line 440, in setup_packagesetup(**metadata)File "/private/var/folders/62/vmczqsnn1pq23nd3m8l20tgm0000gn/T/pip-install-9_bhqerr/numpy_280faa88bab24eab97533beae7f5be03/numpy/distutils/core.py", line 169, in setupreturn old_setup(**new_attr)File "/private/var/folders/62/vmczqsnn1pq23nd3m8l20tgm0000gn/T/pip-build-env-r0ly8_th/overlay/lib/python3.10/site-packages/setuptools/__init__.py", line 165, in setupreturn distutils.core.setup(**attrs)File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/core.py", line 148, in setupdist.run_commands()File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 966, in run_commandsself.run_command(cmd)File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_commandcmd_obj.run()File "/private/var/folders/62/vmczqsnn1pq23nd3m8l20tgm0000gn/T/pip-build-env-r0ly8_th/overlay/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 299, in runself.run_command('build')File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/cmd.py", line 313, in run_commandself.distribution.run_command(command)File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_commandcmd_obj.run()File "/private/var/folders/62/vmczqsnn1pq23nd3m8l20tgm0000gn/T/pip-install-9_bhqerr/numpy_280faa88bab24eab97533beae7f5be03/numpy/distutils/command/build.py", line 61, in runold_build.run(self)File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/command/build.py", line 135, in runself.run_command(cmd_name)File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/cmd.py", line 313, in run_commandself.distribution.run_command(command)File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_commandcmd_obj.run()File "/private/var/folders/62/vmczqsnn1pq23nd3m8l20tgm0000gn/T/pip-install-9_bhqerr/numpy_280faa88bab24eab97533beae7f5be03/numpy/distutils/command/build_src.py", line 144, in runself.build_sources()File "/private/var/folders/62/vmczqsnn1pq23nd3m8l20tgm0000gn/T/pip-install-9_bhqerr/numpy_280faa88bab24eab97533beae7f5be03/numpy/distutils/command/build_src.py", line 155, in build_sourcesself.build_library_sources(*libname_info)File "/private/var/folders/62/vmczqsnn1pq23nd3m8l20tgm0000gn/T/pip-install-9_bhqerr/numpy_280faa88bab24eab97533beae7f5be03/numpy/distutils/command/build_src.py", line 288, in build_library_sourcessources = self.generate_sources(sources, (lib_name, build_info))File "/private/var/folders/62/vmczqsnn1pq23nd3m8l20tgm0000gn/T/pip-install-9_bhqerr/numpy_280faa88bab24eab97533beae7f5be03/numpy/distutils/command/build_src.py", line 378, in generate_sourcessource = func(extension, build_dir)File "numpy/core/setup.py", line 666, in get_mathlib_inforaise RuntimeError("Broken toolchain: cannot link a simple C program")RuntimeError: Broken toolchain: cannot link a simple C program----------------------------------------ERROR: Failed building wheel for numpy
ERROR: Could not build wheels for numpy which use PEP 517 and cannot be installed directly
WARNING: You are using pip version 21.2.3; however, version 21.2.4 is available.
You should consider upgrading via the '/usr/local/bin/python3 -m pip install --upgrade pip' command.

这个错误大概是 numpy-1.21.2 与 Python3.10 版本不匹配导致 ;

【错误记录】Mac 中 IntelliJ IDEA 运行 Python 程序报错 ( No module named ‘numpy‘ )相关推荐

  1. 【错误记录】Mac 中 IntelliJ IDEA 运行 Python 程序报错 ( pip 21.0 will drop support for Python 2.7 in January 20 )

    文章目录 一.报错信息 二.解决方案 一.报错信息 在 [错误记录]Mac 中 IntelliJ IDEA 运行 Python 程序报错 ( No module named 'threadpool' ...

  2. 【错误记录】Mac 中 IntelliJ IDEA 运行 Python 程序报错 ( “Python“ 因为出现问题而无法打开 )

    文章目录 一.报错信息 二.解决方案 一.报错信息 先安装了 Pytnon3.10.0 版本 , 然后有安装了 Python3.6.3 版本 , 安装完成后 , IntelliJ IDEA 中就出现如 ...

  3. 【错误记录】Mac 中 IntelliJ IDEA 运行 Python 程序报错 ( End of statement expected )

    文章目录 一.报错信息 二.解决方案 一.报错信息 将 Python SDK 从 Python 2.7 升级为 Python3.10 后 , 报如下报错 ; 二.解决方案 将 print " ...

  4. 【开发环境】Mac 中 IntelliJ IDEA 运行 Python 程序 ( 安装 Python Community Edition 插件 )

    文章目录 一.安装 Python Community Edition 插件 二.创建 Python 工程 一.安装 Python Community Edition 插件 选择 菜单栏 " ...

  5. 【错误记录】PyCharm 运行 Python 程序报错 ( UnicodeDecodeError: ‘ascii‘ codec can‘t decode byte 0xe5 in positio )

    文章目录 一.报错信息 二.解决方案 一.报错信息 PyCharm 运行 Python 程序报错 : D:\002_Project\011_Python\APK\venv\Scripts\python ...

  6. 【错误记录】PyCharm 运行 Python 程序报错 ( PEP 8: E402 module level import not at top of file )

    文章目录 一.报错信息 二.解决方案 一.报错信息 PyCharm 运行 Python 程序报错 : PEP 8: E402 module level import not at top of fil ...

  7. 【错误记录】PyCharm 运行 Python 程序报错 ( PEP 8: W292 no newline at end of file )

    文章目录 一.报错信息 二.解决方案 一.报错信息 PyCharm 运行 Python 程序报错 : PEP 8: W292 no newline at end of file 二.解决方案 在每个 ...

  8. 【错误记录】PyCharm 运行 Python 程序报错 ( PEP 8: E305 expected 2 blank lines after class or function definiti )

    文章目录 一.报错信息 二.解决方案 一.报错信息 第一次写 Python 代码 , 报错如下 : PEP 8: E305 expected 2 blank lines after class or ...

  9. 运行 python 程序报错 /libmkl_avx2.so: undefined symbol: mkl_sparse_optimize_bsr_trsm_i8 的解决方法

    写在前面 笔者的运行环境:Ubuntu20.04 一.问题描述 运行 python 程序时出现如下报错: INTEL MKL ERROR: /lib/x86_64-linux-gnu/libmkl_a ...

最新文章

  1. 程序员:如何成为一个全栈的工程师?
  2. 【面试被虐】如何只用2GB内存从20亿,40亿,80亿个整数中找到出现次数最多的数?...
  3. wxruby框架例子1
  4. chrome开发总结(交互/权限/存储)-爬虫
  5. Jquery精准计算
  6. 使用trycatch获取异常问题
  7. 公网端口不够用,用这款神器轻松搞定它!
  8. html5兼容包,webpack4搭建现代Hybird-h5工程
  9. 计算机需要那些高中数学知识点,高中数学知识点(高中数学知识点最全版)
  10. 【考研政治】马克思主义基本原理概论——导论篇
  11. 推荐一个微软知识库(Microsoft Knowledge Base)订阅
  12. 《定时执行专家》V5.4软件使用手册
  13. c语言足球管理系统,如足球一般优美的C语言
  14. 麒麟985和麒麟990有什么区别(手机常见问题)
  15. 柜台收取西联汇款经验(网友分享)
  16. tableau关于增长率、占比的表计算实践应用
  17. 00 Mybatis之简介与入门
  18. 降噪蓝牙耳机哪个好?2021主流蓝牙耳机当选降噪耳机
  19. java.lang.IllegalArgumentException: bound must be positive
  20. Redis内存空间简单分析

热门文章

  1. WPF Wonders: Transformations (and Robots!)
  2. JavaScript 与 ASP.NET 页面的完美结合(转)
  3. 快速创建 IEqualityComparerT 和 IComparerT 的实例
  4. 色诱社报道:昨日,腾讯公司公布了2009年发展策划
  5. legend3---5、lavarel爬坑杂记
  6. C#学习笔记--详解委托,事件与回调函数
  7. linux下C++动态链接C++库示例详解
  8. PowerDesigner生成数据库建表sql脚本
  9. 编译原理实验(算符优先文法)
  10. 定时器 Quartz