首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >在VS代码上安装numpy时“准备元数据(pyproject.toml) .错误”

在VS代码上安装numpy时“准备元数据(pyproject.toml) .错误”
EN

Stack Overflow用户
提问于 2022-03-19 06:20:52
回答 2查看 8K关注 0票数 3

所以我试图在VS代码上安装numpy 1.20.3,它说:

代码语言:javascript
运行
AI代码解释
复制
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [239 lines of output]
      setup.py:66: RuntimeWarning: NumPy 1.20.3 may not yet support Python 3.10.
        warnings.warn(
      Running from numpy source directory.
      setup.py:485: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
        run_build = parse_setuppy_commands()
      C:\Users\_\AppData\Local\Temp\pip-install-12pl1k89\numpy_a61d254ad189429092d1fab3dbdca78f\tools\cythonize.py:67: 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\bit_generator.pyx
      Processing numpy/random\mtrand.pyx
      Processing numpy/random\_bounded_integers.pyx.in
      Processing numpy/random\_common.pyx
      Processing numpy/random\_generator.pyx
      Processing numpy/random\_mt19937.pyx
      Processing numpy/random\_pcg64.pyx
      Processing numpy/random\_philox.pyx
      Processing numpy/random\_sfc64.pyx
      Cythonizing sources
      blas_opt_info:
      blas_mkl_info:
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries mkl_rt not found in ['C:\\Users\\_\\OneDrive\\Desktop\\VOR-Models\\2021-VOR-Model\\venv\\lib', 'C:\\']
        NOT AVAILABLE

      blis_info:
        libraries blis not found in ['C:\\Users\\_\\OneDrive\\Desktop\\VOR-Models\\2021-VOR-Model\\venv\\lib', 'C:\\']
        NOT AVAILABLE

      openblas_info:
        libraries openblas not found in ['C:\\Users\\_\\OneDrive\\Desktop\\VOR-Models\\2021-VOR-Model\\venv\\lib', 'C:\\']
      get_default_fcompiler: matching types: '['gnu', 'intelv', 'absoft', 'compaqv', 'intelev', 'gnu95', 'g95', 'intelvem', 'intelem', 'flang']'
      customize GnuFCompiler
      Could not locate executable g77
      Could not locate executable f77
      customize IntelVisualFCompiler
      Could not locate executable ifort
      Could not locate executable ifl
      customize AbsoftFCompiler
      Could not locate executable f90
      customize CompaqVisualFCompiler
      Could not locate executable DF
      customize IntelItaniumVisualFCompiler
      Could not locate executable efl
      customize Gnu95FCompiler
      Could not locate executable gfortran
      Could not locate executable f95
      customize G95FCompiler
      Could not locate executable g95
      customize IntelEM64VisualFCompiler
      customize IntelEM64TFCompiler
      Could not locate executable efort
      Could not locate executable efc
      customize PGroupFlangCompiler
      Could not locate executable flang
      don't know how to compile Fortran code on platform 'nt'
        NOT AVAILABLE

      atlas_3_10_blas_threads_info:
      Setting PTATLAS=ATLAS
        libraries tatlas not found in ['C:\\Users\\_\\OneDrive\\Desktop\\VOR-Models\\2021-VOR-Model\\venv\\lib', 'C:\\']
        NOT AVAILABLE

      atlas_3_10_blas_info:
        libraries satlas not found in ['C:\\Users\\_\\OneDrive\\Desktop\\VOR-Models\\2021-VOR-Model\\venv\\lib', 'C:\\']
        NOT AVAILABLE

      atlas_blas_threads_info:
      Setting PTATLAS=ATLAS
        libraries ptf77blas,ptcblas,atlas not found in ['C:\\Users\\_\\OneDrive\\Desktop\\VOR-Models\\2021-VOR-Model\\venv\\lib', 'C:\\']
        NOT AVAILABLE

      atlas_blas_info:
        libraries f77blas,cblas,atlas not found in ['C:\\Users\\_\\OneDrive\\Desktop\\VOR-Models\\2021-VOR-Model\\venv\\lib', 'C:\\']
        NOT AVAILABLE

      C:\Users\_\AppData\Local\Temp\pip-install-12pl1k89\numpy_a61d254ad189429092d1fab3dbdca78f\numpy\distutils\system_info.py:1989: UserWarning:
          Optimized (vendor) Blas libraries are not found.
          Falls back to netlib Blas library which has worse performance.
          A better performance should be easily gained by switching
          Blas library.
        if self._calc_info(blas):
      blas_info:
        libraries blas not found in ['C:\\Users\\_\\OneDrive\\Desktop\\VOR-Models\\2021-VOR-Model\\venv\\lib', 'C:\\']
        NOT AVAILABLE

      C:\Users\_\AppData\Local\Temp\pip-install-12pl1k89\numpy_a61d254ad189429092d1fab3dbdca78f\numpy\distutils\system_info.py:1989: UserWarning:
          Blas (http://www.netlib.org/blas/) libraries not found.
          Directories to search for the libraries can be specified in the
          numpy/distutils/site.cfg file (section [blas]) or by setting
          the BLAS environment variable.
        if self._calc_info(blas):
      blas_src_info:
        NOT AVAILABLE

      C:\Users\_\AppData\Local\Temp\pip-install-12pl1k89\numpy_a61d254ad189429092d1fab3dbdca78f\numpy\distutils\system_info.py:1989: UserWarning:
          Blas (http://www.netlib.org/blas/) sources not found.
          Directories to search for the sources can be specified in the
          numpy/distutils/site.cfg file (section [blas_src]) or by setting
          the BLAS_SRC environment variable.
        if self._calc_info(blas):
        NOT AVAILABLE

      non-existing path in 'numpy\\distutils': 'site.cfg'
      lapack_opt_info:
      lapack_mkl_info:
        libraries mkl_rt not found in ['C:\\Users\\_\\OneDrive\\Desktop\\VOR-Models\\2021-VOR-Model\\venv\\lib', 'C:\\']
        NOT AVAILABLE

      openblas_lapack_info:
        libraries openblas not found in ['C:\\Users\\_\\OneDrive\\Desktop\\VOR-Models\\2021-VOR-Model\\venv\\lib', 'C:\\']
        NOT AVAILABLE

      openblas_clapack_info:
        libraries openblas,lapack not found in ['C:\\Users\\_\\OneDrive\\Desktop\\VOR-Models\\2021-VOR-Model\\venv\\lib', 'C:\\']
        NOT AVAILABLE

      flame_info:
        libraries flame not found in ['C:\\Users\\_\\OneDrive\\Desktop\\VOR-Models\\2021-VOR-Model\\venv\\lib', 'C:\\']
        NOT AVAILABLE

      atlas_3_10_threads_info:
      Setting PTATLAS=ATLAS
        libraries lapack_atlas not found in C:\Users\_\OneDrive\Desktop\VOR-Models\2021-VOR-Model\venv\lib
        libraries tatlas,tatlas not found in C:\Users\_\OneDrive\Desktop\VOR-Models\2021-VOR-Model\venv\lib
        libraries lapack_atlas not found in C:\
        libraries tatlas,tatlas not found in C:\
      <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
        NOT AVAILABLE

      atlas_3_10_info:
        libraries lapack_atlas not found in C:\Users\_\OneDrive\Desktop\VOR-Models\2021-VOR-Model\venv\lib
        libraries satlas,satlas not found in C:\Users\_\OneDrive\Desktop\VOR-Models\2021-VOR-Model\venv\lib
        libraries lapack_atlas not found in C:\
        libraries satlas,satlas not found in C:\
      <class 'numpy.distutils.system_info.atlas_3_10_info'>
        NOT AVAILABLE

      atlas_threads_info:
      Setting PTATLAS=ATLAS
        libraries lapack_atlas not found in C:\Users\_\OneDrive\Desktop\VOR-Models\2021-VOR-Model\venv\lib
        libraries ptf77blas,ptcblas,atlas not found in C:\Users\_\OneDrive\Desktop\VOR-Models\2021-VOR-Model\venv\lib
        libraries lapack_atlas not found in C:\
        libraries ptf77blas,ptcblas,atlas not found in C:\
      <class 'numpy.distutils.system_info.atlas_threads_info'>
        NOT AVAILABLE

      atlas_info:
        libraries lapack_atlas not found in C:\Users\_\OneDrive\Desktop\VOR-Models\2021-VOR-Model\venv\lib
        libraries f77blas,cblas,atlas not found in C:\Users\_\OneDrive\Desktop\VOR-Models\2021-VOR-Model\venv\lib
        libraries lapack_atlas not found in C:\
        libraries f77blas,cblas,atlas not found in C:\
      <class 'numpy.distutils.system_info.atlas_info'>
        NOT AVAILABLE

      lapack_info:
        libraries lapack not found in ['C:\\Users\\_\\OneDrive\\Desktop\\VOR-Models\\2021-VOR-Model\\venv\\lib', 'C:\\']
        NOT AVAILABLE

      C:\Users\_\AppData\Local\Temp\pip-install-12pl1k89\numpy_a61d254ad189429092d1fab3dbdca78f\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

      C:\Users\_\AppData\Local\Temp\pip-install-12pl1k89\numpy_a61d254ad189429092d1fab3dbdca78f\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

      numpy_linalg_lapack_lite:
        FOUND:
          language = c
          define_macros = [('HAVE_BLAS_ILP64', None), ('BLAS_SYMBOL_SUFFIX', '64_')]

      C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.752.0_x64__qbz5n2kfra8p0\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'define_macros'
        warnings.warn(msg)
      running dist_info
      running build_src
      build_src
      building py_modules sources
      creating build
      creating build\src.win-amd64-3.10
      creating build\src.win-amd64-3.10\numpy
      creating build\src.win-amd64-3.10\numpy\distutils
      building library "npymath" sources
      LINK : fatal error LNK1104: cannot open file 'kernel32.lib'
      Traceback (most recent call last):
        File "C:\Users\_\OneDrive\Desktop\VOR-Models\2021-VOR-Model\venv\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 363, in <module>
          main()
        File "C:\Users\_\OneDrive\Desktop\VOR-Models\2021-VOR-Model\venv\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "C:\Users\_\OneDrive\Desktop\VOR-Models\2021-VOR-Model\venv\lib\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 "C:\Users\_\AppData\Local\Temp\pip-build-env-fmnw10id\overlay\Lib\site-packages\setuptools\build_meta.py", line 157, in prepare_metadata_for_build_wheel
          self.run_setup()
        File "C:\Users\_\AppData\Local\Temp\pip-build-env-fmnw10id\overlay\Lib\site-packages\setuptools\build_meta.py", line 248, in run_setup
          super(_BuildMetaLegacyBackend,
        File "C:\Users\_\AppData\Local\Temp\pip-build-env-fmnw10id\overlay\Lib\site-packages\setuptools\build_meta.py", line 142, in run_setup
          exec(compile(code, __file__, 'exec'), locals())
        File "setup.py", line 513, in <module>
          setup_package()
        File "setup.py", line 505, in setup_package
          setup(**metadata)
        File "C:\Users\_\AppData\Local\Temp\pip-install-12pl1k89\numpy_a61d254ad189429092d1fab3dbdca78f\numpy\distutils\core.py", line 169, in setup
          return old_setup(**new_attr)
        File "C:\Users\_\AppData\Local\Temp\pip-build-env-fmnw10id\overlay\Lib\site-packages\setuptools\__init__.py", line 165, in setup
          return distutils.core.setup(**attrs)
        File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.752.0_x64__qbz5n2kfra8p0\lib\distutils\core.py", line 148, in setup
          dist.run_commands()
        File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.752.0_x64__qbz5n2kfra8p0\lib\distutils\dist.py", line 966, in run_commands
          self.run_command(cmd)
        File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.752.0_x64__qbz5n2kfra8p0\lib\distutils\dist.py", line 985, in run_command
          cmd_obj.run()
        File "C:\Users\_\AppData\Local\Temp\pip-build-env-fmnw10id\overlay\Lib\site-packages\setuptools\command\dist_info.py", line 31, in run
          egg_info.run()
        File "C:\Users\\AppData\Local\Temp\pip-install-12pl1k89\numpy_a61d254ad189429092d1fab3dbdca78f\numpy\distutils\command\egg_info.py", line 24, in run
          self.run_command("build_src")
        File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.752.0_x64__qbz5n2kfra8p0\lib\distutils\cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.752.0_x64__qbz5n2kfra8p0\lib\distutils\dist.py", line 985, in run_command
          cmd_obj.run()
        File "C:\Users\_\AppData\Local\Temp\pip-install-12pl1k89\numpy_a61d254ad189429092d1fab3dbdca78f\numpy\distutils\command\build_src.py", line 144, in run
          self.build_sources()
        File "C:\Users\_\AppData\Local\Temp\pip-install-12pl1k89\numpy_a61d254ad189429092d1fab3dbdca78f\numpy\distutils\command\build_src.py", line 155, in build_sources
          self.build_library_sources(*libname_info)
        File "C:\Users\_\AppData\Local\Temp\pip-install-12pl1k89\numpy_a61d254ad189429092d1fab3dbdca78f\numpy\distutils\command\build_src.py", line 288, in build_library_sources
          sources = self.generate_sources(sources, (lib_name, build_info))
        File "C:\Users\_\AppData\Local\Temp\pip-install-12pl1k89\numpy_a61d254ad189429092d1fab3dbdca78f\numpy\distutils\command\build_src.py", line 378, in generate_sources
          source = func(extension, build_dir)
        File "numpy\core\setup.py", line 676, in get_mathlib_info
          raise RuntimeError("Broken toolchain: cannot link a simple C program")
      RuntimeError: Broken toolchain: cannot link a simple C program
      [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.

我是这样安装的:

( -r ) PS C:\Users_\OneDrive\Desktop\VOR-Models\2021-VOR-Model> pip安装-r requirements.txt

因为我太迷茫了,我会给你看requirements.txt。这个函数实际上是在numpy之前安装所有东西,然后就失败了。

代码语言:javascript
运行
AI代码解释
复制
clearbeautifulsoup4==4.9.3
certifi==2021.5.30
chardet==4.0.0
idna==2.10
numpy==1.20.3
pandas==1.2.4
python-dateutil==2.8.1
pytz==2021.1
requests==2.25.1
six==1.16.0
soupsieve==2.2.1
urllib3==1.26.5

任何帮助都是非常感谢的。我之所以这么做,是因为我在网上上了一门课程(https://www.fantasyfootballdatapros.com/),并试图与熊猫一起进行数据处理。我需要NumPy。我也试着看其他的问题,但是他们没有给我我需要的答案,或者根本没有答案。请帮帮忙。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2022-04-08 09:41:42

它是在错误信息中写的。

RuntimeWarning: NumPy 1.20.3可能还不支持Python3.10。

两次快速尝试:

  1. 在不查看每个包的情况下,尝试从需求中删除numpy,然后再次运行"python -m pip install -r requirements.txt“。然后,在命令行中,尝试键入这个命令,看看它是否已安装,因为其他包(例如。自动安装numpy及其所依赖的版本)。

python -m numpy

  1. 尝试一个较低的numpy版本。在requirments.txt内部尝试键入或低于1.20.3

的内容

numpy==1.19.2

票数 1
EN

Stack Overflow用户

发布于 2022-06-14 05:14:31

同样的事也发生在我身上。所以,我删除了我的矮胖的版本。然后,requirements.txt运行得很好。

代码语言:javascript
运行
AI代码解释
复制
text-unidecode==1.3
icecream==2.1.1
datetime==4.3
numpy     
python-dotenv==0.19.0
flask
bigquery==0.0.15   
google-cloud==0.34.0                   
google-cloud-bigquery>=2.14.0                                              
gspread==3.0.1
gcsfs==2021.6.1
pandas-gbq==0.15.0
ipython==7.5.0
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71538933

复制
相关文章
Python异常处理traceback和exc_info
开发过程中一般都会使用traceback将捕获到的异常打印出来。 import traceback def fake_exception(): 1 / 0 def catch_exception(): try: fake_exception() except: traceback.print_exc() catch_exception() 结果 Traceback (most recent call last): File ".\test.p
Ewdager
2020/07/14
6490
Python 日志打印之logging.config.dictConfig使用总结
dictConfig函数位于logging.config模块,该函数通过字典参数config对logging进行配置。3.2版本新增的函数
授客
2021/01/13
4.1K2
11 | Tornado源码分析:Gen 对象(下)
我们先看一下源码(我已经进行过整理的源码,主要方面大家去理解里面的实现逻辑,若想看完整的源码建议大家可以自行查看本机安装的 tornado 版本中的源代码),在源码中我做了一些批注,这样有利于大家更好的去结合代码来深入了解 其内部的运作。
python编程从入门到实践
2020/09/09
4260
Openstack之log详解
openstack中的日志由oslo_log统一实现,延续了openstack一贯的封装大法,以十分友好的方式将接口提供给各个组件使用。
tunsuy
2022/10/27
4940
[源码解析] PyTorch 流水线并行实现 (6)--并行计算
前几篇文章我们介绍了 PyTorch 流水线并行的基本知识,自动平衡机制和切分数据,本文我们结合论文内容来看看如何实现流水线。
罗西的思考
2021/10/13
1.5K0
12 | Tornado源码分析:BaseIOStream 对象(上)
hello 大家好 通过前几期我们已经聊了 Tornado 中协程的创建、运行,本期我们开始聊聊 tornado 中 网络读写数据处理相关的内容,这部分还是比较复杂的我们打算拆分成几期来聊。
python编程从入门到实践
2020/09/16
4630
PyTorch 源码解读之流水线并行
如图所示为谷歌提出的流水线并行算法,名为 GPipe,论文位于 https://arxiv.org/abs/1811.06965。首先将模型切分为连续的多个 stage,每个 stage 占据一台设备,从而利用多台设备容纳下单设备无法容纳的模型。其次,GPipe 将 mini-batch 切分为多个 micro-batch,每次只处理一个 micro-batch。在处理完当个 micro-batch 后,该 micro-batch 的结果将会被发送给下一台设备,同时开始处理下一个 micro-batch。
OpenMMLab 官方账号
2023/09/28
8320
PyTorch 源码解读之流水线并行
uwsgi日志中文问题
开发项目,使用uwsgi,遇到个头痛的问题,如果指定了uwsgi打印日志,当日志中写入中文时,直接会导致报错
fanspring
2019/06/27
1.7K0
Python常用库 - logging日志库
logging 使用非常简单,使用 basicConfig() 方法就能满足基本的使用需要;如果方法没有传入参数,会根据默认的配置创建Logger 对象,默认的日志级别被设置为 WARNING,该函数可选的参数如下表所示。
小菠萝测试笔记
2020/06/09
8540
如何扩展python的logging组件支持json日志输出
这两天在优化公司一个python的项目,顺便研究了一下如何将python日志转成json格式,原来在Java的项目中搞过类似的事情,知道日志转成json之后有很多便利的之处,最常见的就是可以直接对接各种日志分析系统,如开源的ELK,将数据导入之后就能快速的进行查询和分析,方便做各种统计,监控或报警等。
我是攻城师
2019/03/06
3.1K0
如何扩展python的logging组件支持json日志输出
Python Web开发中的WSGI协议
 在Python Web开发中,我们一般使用Flask、Django等web框架来开发应用程序,生产环境中将应用部署到Apache、Nginx等web服务器时,还需要uWSGI或者Gunicorn。一个完整的部署应该类似这样:
py3study
2020/01/16
9170
09 | Tornado源码分析:Future 对象
今天我们来看一下 Future 这个对象。从字面意思来看有“未来,将来......”之意义。那它在Tornado 构建的体系中扮演者什么样的角色呢?我们先看一下它的源码:
python编程从入门到实践
2020/07/28
8750
python 查找指定目录下的指定类型文件 脚本
""" Find the largest file of a given type in an arbitrary directory tree. Avoid repeat paths, catch errors, add tracing and line count size. Also uses sets, file iterators and generator to avoid loading entire file, and attempts to work around undecodable dir/file name prints. """
用户5760343
2022/05/13
1.6K0
scrapy进阶开发(一):scrapy架构源码分析
其子类有HtmlResponse,TextResponse,XmlResponse
Meet相识
2018/09/12
2.5K0
scrapy进阶开发(一):scrapy架构源码分析
tf.train.Coordinator
任何线程都可以调用coord.request_stop()来请求所有线程停止。为了配合请求,每个线程必须定期检查coord .should_stop()。一旦调用了coord.request_stop(), coord.should_stop()将返回True。 一个典型的线程运行协调器会做如下事情:
狼啸风云
2019/06/13
1.6K0
python gui中线程的调用
""" ################################################################################# System-wide thread interface utilities for GUIs.
用户5760343
2022/05/13
3770
一篇文章带你搞定Python中logging模块
日志是什么?这个不用多解释。百分之九十的程序都需要提供日志功能。Python内置的logging模块,为我们提供了现成的高效好用的日志解决方案。但是,不是所有的场景都需要使用logging模块,
Go进阶者
2021/11/19
4390
一篇文章带你搞定Python中logging模块
点击加载更多

相似问题

反应-本机:挠曲盒对齐

24

右对齐反应本机挠曲盒

32

挠曲盒高度在反应本机

10

挠曲盒响应导航问题

10

图像内响应挠曲盒问题

30
添加站长 进交流群

领取专属 10元无门槛券

AI混元助手 在线答疑

扫码加入开发者社群
关注 腾讯云开发者公众号

洞察 腾讯核心技术

剖析业界实践案例

扫码关注腾讯云开发者公众号
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
查看详情【社区公告】 技术创作特训营有奖征文