当前位置: 首页 > news >正文

ERROR: Failed cleaning build dir for numpy Failed > to build numpy ERROR

文章目录

    • 问题
    • 解决方法
      • 错误原因:python和numpy版本不兼容

问题

(d2l) PS D:\project\test_st> pip install numpy==1.16.2
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple

Collecting numpy==1.16.2 Downloading
https://pypi.tuna.tsinghua.edu.cn/packages/cf/8d/6345b4f32b37945fedc1e027e83970005fc9c699068d2f566b82826515f2/numpy-1.16.2.zip
(5.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.1/5.1 MB 6.0 MB/s eta 0:00:00 Preparing metadata (setup.py) … done Building wheels for
collected packages: numpy Building wheel for numpy (setup.py) …
error error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully. │ exit
code: 1 ╰─> [17 lines of output]
Running from numpy source directory.
C:\Users\admin\AppData\Local\Temp\pip-install-0pyo81at\numpy_a8c97502239c47d7b6aa2749a831007d\numpy\distutils\misc_util.py:476:
SyntaxWarning: “is” with a literal. Did you mean “==”?
return is_string(s) and (‘*’ in s or ‘?’ is s)
Traceback (most recent call last):
File “”, line 2, in
File “”, line 34, in
File “C:\Users\admin\AppData\Local\Temp\pip-install-0pyo81at\numpy_a8c97502239c47d7b6aa2749a831007d\setup.py”,
line 415, in
setup_package()
File “C:\Users\admin\AppData\Local\Temp\pip-install-0pyo81at\numpy_a8c97502239c47d7b6aa2749a831007d\setup.py”,
line 394, in setup_package
from numpy.distutils.core import setup
File “C:\Users\admin\AppData\Local\Temp\pip-install-0pyo81at\numpy_a8c97502239c47d7b6aa2749a831007d\numpy\distutils\core.py”,
line 26, in
from numpy.distutils.command import config, config_compiler,
File “C:\Users\admin\AppData\Local\Temp\pip-install-0pyo81at\numpy_a8c97502239c47d7b6aa2749a831007d\numpy\distutils\command\config.py”,
line 19, in
from numpy.distutils.mingw32ccompiler import generate_manifest
File “C:\Users\admin\AppData\Local\Temp\pip-install-0pyo81at\numpy_a8c97502239c47d7b6aa2749a831007d\numpy\distutils\mingw32ccompiler.py”,
line 34, in
from distutils.msvccompiler import get_build_version as get_build_msvc_version
ModuleNotFoundError: No module named ‘distutils.msvccompiler’
[end of output]

note: This error originates from a subprocess, and is likely not a
problem with pip. ERROR: Failed building wheel for numpy Running
setup.py clean for numpy error: subprocess-exited-with-error

× python setup.py clean did not run successfully. │ exit code: 1
╰─> [10 lines of output]
Running from numpy source directory.

  `setup.py clean` is not supported, use one of the following instead:- `git clean -xdf` (cleans all files)- `git clean -Xdf` (cleans all versioned files, doesn't touchfiles that aren't checked into the git repo)Add `--force` to your command to use it anyway if you must (unsupported).[end of output]

note: This error originates from a subprocess, and is likely not a
problem with pip. ERROR: Failed cleaning build dir for numpy Failed
to build numpy ERROR: ERROR: Failed to build installable wheels for
some pyproject.toml based projects (numpy) (d2l) PS
D:\project\test_st> pip install numpy1.16.2 Looking in indexes:
https://pypi.tuna.tsinghua.edu.cn/simple Collecting numpy
1.16.2
Using cached
https://pypi.tuna.tsinghua.edu.cn/packages/cf/8d/6345b4f32b37945fedc1e027e83970005fc9c699068d2f566b82826515f2/numpy-1.16.2.zip
(5.1 MB) Preparing metadata (setup.py) … done Building wheels for
collected packages: numpy Building wheel for numpy (setup.py) …
error error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully. │ exit
code: 1 ╰─> [17 lines of output]
Running from numpy source directory.
C:\Users\admin\AppData\Local\Temp\pip-install-as22iokr\numpy_ee62379734464183a9bae051cca214d8\numpy\distutils\misc_util.py:476:
SyntaxWarning: “is” with a literal. Did you mean “==”?
return is_string(s) and (‘*’ in s or ‘?’ is s)
Traceback (most recent call last):
File “”, line 2, in
File “”, line 34, in
File “C:\Users\admin\AppData\Local\Temp\pip-install-as22iokr\numpy_ee62379734464183a9bae051cca214d8\setup.py”,
line 415, in
setup_package()

    - `git clean -xdf` (cleans all files)- `git clean -Xdf` (cleans all versioned files, doesn't touchfiles that aren't checked into the git repo)Add `--force` to your command to use it anyway if you must (unsupported).[end of output]

note: This error originates from a subprocess, and is likely not a
problem with pip. ERROR: Failed cleaning build dir for numpy Failed
to build numpy ERROR: ERROR: Failed to build installable wheels for
some pyproject.toml based projects (numpy)

解决方法

匹配pythonnumpy的版本

当降低numpy<1.16.3版本,但需要注意你的python版本为2.73.5-3.7

# python = 3.7
conda create -n name python=3.7
pip install numpy==1.16.2

Numpy官网:https://numpy.org/doc/stable/reference/generated/numpy.load.html
在这里插入图片描述

错误原因:python和numpy版本不兼容

查看我python的版本和numpy的版本
在这里插入图片描述
numpy=1.16.1和1.16.2,与我环境中的python=3.9不兼容,会出现以下错误:

ModuleNotFoundError: No module named ‘distutils.msvccompiler’
[end of output]

    - `git clean -xdf` (cleans all files)- `git clean -Xdf` (cleans all versioned files, doesn't touchfiles that aren't checked into the git repo)Add `--force` to your command to use it anyway if you must (unsupported).[end of output]

note: This error originates from a subprocess, and is likely not a
problem with pip. ERROR: Failed cleaning build dir for numpy Failed
to build numpy ERROR: ERROR: Failed to build installable wheels for
some pyproject.toml based projects (numpy)

会出现下面的提醒与报错:
在这里插入图片描述
在这里插入图片描述


http://www.mrgr.cn/news/63768.html

相关文章:

  • JavaIO流操作
  • Flutter学习笔记(一)-----环境配置
  • 推荐一款用来快速开发3D建筑模型软件:Allplan
  • U盘文件不翼而飞?这些数据恢复工具帮你找回!
  • GBDT 算法的原理推导
  • Redis- 内核的分配内存限制的警告“WARNING Memory overcommit must be enabled!”
  • 一键切换暗黑模式,这些代码片段你不可错过
  • 直流电机在液压泵领域的应用
  • ubuntu运行gazebo导致内存越来越少
  • Android 同花顺面经
  • 面试题分享1
  • 【染色时间】
  • markdown/Latex分子,分母,除号,怎么编辑
  • 如何实现千万级数据表的快速分页查询
  • 题目:0的个数
  • 冰雪奇缘!中科院一区算法+双向深度学习+注意力机制!SAO-BiTCN-BiGRU-Attention雪消融算法优化回归预测
  • systemctl restart NetworkManager 重启后,文件/etc/resolv.conf修改失败
  • Java XML一口气讲完!(p≧w≦q)
  • 利用frp进行SSH端口转发(内网穿透同理)
  • 【每日C/C++问题】
  • 【数据库系统概论】第3章 关系数据库标准语言SQL(一)数据查询(超详细)
  • __init__.py __all__和 __name__的作用及其用法
  • 《DelayQueue:Java界的“延时大师”》
  • Android 字节飞书面经
  • 生信入门第八课:RNA-seq比对、定量和差异分析
  • 项目_Linux_网络编程_私人云盘