在 VS 代码上安装 numpy 时出现“准备元数据 (pyproject.toml) ... 错误”(Fantasy Football Data Pros:Data Munging with Pandas)

Ayu*_*ati 5 python numpy

所以我试图在 VS Code 上安装 numpy 1.20.3,当它显示:

\n
  Preparing metadata (pyproject.toml) ... error\n  error: subprocess-exited-with-error\n  \n  \xc3\x97 Preparing metadata (pyproject.toml) did not run successfully.\n  \xe2\x94\x82 exit code: 1\n  \xe2\x95\xb0\xe2\x94\x80> [239 lines of output]\n      setup.py:66: RuntimeWarning: NumPy 1.20.3 may not yet support Python 3.10.\n        warnings.warn(\n      Running from numpy source directory.\n      setup.py:485: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates\n        run_build = parse_setuppy_commands()\n      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\n        from distutils.version import LooseVersion\n      Processing numpy/random\\_bounded_integers.pxd.in\n      Processing numpy/random\\bit_generator.pyx\n      Processing numpy/random\\mtrand.pyx\n      Processing numpy/random\\_bounded_integers.pyx.in\n      Processing numpy/random\\_common.pyx\n      Processing numpy/random\\_generator.pyx\n      Processing numpy/random\\_mt19937.pyx\n      Processing numpy/random\\_pcg64.pyx\n      Processing numpy/random\\_philox.pyx\n      Processing numpy/random\\_sfc64.pyx\n      Cythonizing sources\n      blas_opt_info:\n      blas_mkl_info:\n      No module named \'numpy.distutils._msvccompiler\' in numpy.distutils; trying from distutils\n      customize MSVCCompiler\n        libraries mkl_rt not found in [\'C:\\\\Users\\\\_\\\\OneDrive\\\\Desktop\\\\VOR-Models\\\\2021-VOR-Model\\\\venv\\\\lib\', \'C:\\\\\']\n        NOT AVAILABLE\n\n      blis_info:\n        libraries blis not found in [\'C:\\\\Users\\\\_\\\\OneDrive\\\\Desktop\\\\VOR-Models\\\\2021-VOR-Model\\\\venv\\\\lib\', \'C:\\\\\']\n        NOT AVAILABLE\n\n      openblas_info:\n        libraries openblas not found in [\'C:\\\\Users\\\\_\\\\OneDrive\\\\Desktop\\\\VOR-Models\\\\2021-VOR-Model\\\\venv\\\\lib\', \'C:\\\\\']\n      get_default_fcompiler: matching types: \'[\'gnu\', \'intelv\', \'absoft\', \'compaqv\', \'intelev\', \'gnu95\', \'g95\', \'intelvem\', \'intelem\', \'flang\']\'\n      customize GnuFCompiler\n      Could not locate executable g77\n      Could not locate executable f77\n      customize IntelVisualFCompiler\n      Could not locate executable ifort\n      Could not locate executable ifl\n      customize AbsoftFCompiler\n      Could not locate executable f90\n      customize CompaqVisualFCompiler\n      Could not locate executable DF\n      customize IntelItaniumVisualFCompiler\n      Could not locate executable efl\n      customize Gnu95FCompiler\n      Could not locate executable gfortran\n      Could not locate executable f95\n      customize G95FCompiler\n      Could not locate executable g95\n      customize IntelEM64VisualFCompiler\n      customize IntelEM64TFCompiler\n      Could not locate executable efort\n      Could not locate executable efc\n      customize PGroupFlangCompiler\n      Could not locate executable flang\n      don\'t know how to compile Fortran code on platform \'nt\'\n        NOT AVAILABLE\n\n      atlas_3_10_blas_threads_info:\n      Setting PTATLAS=ATLAS\n        libraries tatlas not found in [\'C:\\\\Users\\\\_\\\\OneDrive\\\\Desktop\\\\VOR-Models\\\\2021-VOR-Model\\\\venv\\\\lib\', \'C:\\\\\']\n        NOT AVAILABLE\n\n      atlas_3_10_blas_info:\n        libraries satlas not found in [\'C:\\\\Users\\\\_\\\\OneDrive\\\\Desktop\\\\VOR-Models\\\\2021-VOR-Model\\\\venv\\\\lib\', \'C:\\\\\']\n        NOT AVAILABLE\n\n      atlas_blas_threads_info:\n      Setting PTATLAS=ATLAS\n        libraries ptf77blas,ptcblas,atlas not found in [\'C:\\\\Users\\\\_\\\\OneDrive\\\\Desktop\\\\VOR-Models\\\\2021-VOR-Model\\\\venv\\\\lib\', \'C:\\\\\']\n        NOT AVAILABLE\n\n      atlas_blas_info:\n        libraries f77blas,cblas,atlas not found in [\'C:\\\\Users\\\\_\\\\OneDrive\\\\Desktop\\\\VOR-Models\\\\2021-VOR-Model\\\\venv\\\\lib\', \'C:\\\\\']\n        NOT AVAILABLE\n\n      C:\\Users\\_\\AppData\\Local\\Temp\\pip-install-12pl1k89\\numpy_a61d254ad189429092d1fab3dbdca78f\\numpy\\distutils\\system_info.py:1989: UserWarning:\n          Optimized (vendor) Blas libraries are not found.\n          Falls back to netlib Blas library which has worse performance.\n          A better performance should be easily gained by switching\n          Blas library.\n        if self._calc_info(blas):\n      blas_info:\n        libraries blas not found in [\'C:\\\\Users\\\\_\\\\OneDrive\\\\Desktop\\\\VOR-Models\\\\2021-VOR-Model\\\\venv\\\\lib\', \'C:\\\\\']\n        NOT AVAILABLE\n\n      C:\\Users\\_\\AppData\\Local\\Temp\\pip-install-12pl1k89\\numpy_a61d254ad189429092d1fab3dbdca78f\\numpy\\distutils\\system_info.py:1989: UserWarning:\n          Blas (http://www.netlib.org/blas/) libraries not found.\n          Directories to search for the libraries can be specified in the\n          numpy/distutils/site.cfg file (section [blas]) or by setting\n          the BLAS environment variable.\n        if self._calc_info(blas):\n      blas_src_info:\n        NOT AVAILABLE\n\n      C:\\Users\\_\\AppData\\Local\\Temp\\pip-install-12pl1k89\\numpy_a61d254ad189429092d1fab3dbdca78f\\numpy\\distutils\\system_info.py:1989: UserWarning:\n          Blas (http://www.netlib.org/blas/) sources not found.\n          Directories to search for the sources can be specified in the\n          numpy/distutils/site.cfg file (section [blas_src]) or by setting\n          the BLAS_SRC environment variable.\n        if self._calc_info(blas):\n        NOT AVAILABLE\n\n      non-existing path in \'numpy\\\\distutils\': \'site.cfg\'\n      lapack_opt_info:\n      lapack_mkl_info:\n        libraries mkl_rt not found in [\'C:\\\\Users\\\\_\\\\OneDrive\\\\Desktop\\\\VOR-Models\\\\2021-VOR-Model\\\\venv\\\\lib\', \'C:\\\\\']\n        NOT AVAILABLE\n\n      openblas_lapack_info:\n        libraries openblas not found in [\'C:\\\\Users\\\\_\\\\OneDrive\\\\Desktop\\\\VOR-Models\\\\2021-VOR-Model\\\\venv\\\\lib\', \'C:\\\\\']\n        NOT AVAILABLE\n\n      openblas_clapack_info:\n        libraries openblas,lapack not found in [\'C:\\\\Users\\\\_\\\\OneDrive\\\\Desktop\\\\VOR-Models\\\\2021-VOR-Model\\\\venv\\\\lib\', \'C:\\\\\']\n        NOT AVAILABLE\n\n      flame_info:\n        libraries flame not found in [\'C:\\\\Users\\\\_\\\\OneDrive\\\\Desktop\\\\VOR-Models\\\\2021-VOR-Model\\\\venv\\\\lib\', \'C:\\\\\']\n        NOT AVAILABLE\n\n      atlas_3_10_threads_info:\n      Setting PTATLAS=ATLAS\n        libraries lapack_atlas not found in C:\\Users\\_\\OneDrive\\Desktop\\VOR-Models\\2021-VOR-Model\\venv\\lib\n        libraries tatlas,tatlas not found in C:\\Users\\_\\OneDrive\\Desktop\\VOR-Models\\2021-VOR-Model\\venv\\lib\n        libraries lapack_atlas not found in C:\\\n        libraries tatlas,tatlas not found in C:\\\n      <class \'numpy.distutils.system_info.atlas_3_10_threads_info\'>\n        NOT AVAILABLE\n\n      atlas_3_10_info:\n        libraries lapack_atlas not found in C:\\Users\\_\\OneDrive\\Desktop\\VOR-Models\\2021-VOR-Model\\venv\\lib\n        libraries satlas,satlas not found in C:\\Users\\_\\OneDrive\\Desktop\\VOR-Models\\2021-VOR-Model\\venv\\lib\n        libraries lapack_atlas not found in C:\\\n        libraries satlas,satlas not found in C:\\\n      <class \'numpy.distutils.system_info.atlas_3_10_info\'>\n        NOT AVAILABLE\n\n      atlas_threads_info:\n      Setting PTATLAS=ATLAS\n        libraries lapack_atlas not found in C:\\Users\\_\\OneDrive\\Desktop\\VOR-Models\\2021-VOR-Model\\venv\\lib\n        libraries ptf77blas,ptcblas,atlas not found in C:\\Users\\_\\OneDrive\\Desktop\\VOR-Models\\2021-VOR-Model\\venv\\lib\n        libraries lapack_atlas not found in C:\\\n        libraries ptf77blas,ptcblas,atlas not found in C:\\\n      <class \'numpy.distutils.system_info.atlas_threads_info\'>\n        NOT AVAILABLE\n\n      atlas_info:\n        libraries lapack_atlas not found in C:\\Users\\_\\OneDrive\\Desktop\\VOR-Models\\2021-VOR-Model\\venv\\lib\n        libraries f77blas,cblas,atlas not found in C:\\Users\\_\\OneDrive\\Desktop\\VOR-Models\\2021-VOR-Model\\venv\\lib\n        libraries lapack_atlas not found in C:\\\n        libraries f77blas,cblas,atlas not found in C:\\\n      <class \'numpy.distutils.system_info.atlas_info\'>\n        NOT AVAILABLE\n\n      lapack_info:\n        libraries lapack not found in [\'C:\\\\Users\\\\_\\\\OneDrive\\\\Desktop\\\\VOR-Models\\\\2021-VOR-Model\\\\venv\\\\lib\', \'C:\\\\\']\n        NOT AVAILABLE\n\n      C:\\Users\\_\\AppData\\Local\\Temp\\pip-install-12pl1k89\\numpy_a61d254ad189429092d1fab3dbdca78f\\numpy\\distutils\\system_info.py:1849: UserWarning:\n          Lapack (http://www.netlib.org/lapack/) libraries not found.\n          Directories to search for the libraries can be specified in the\n          numpy/distutils/site.cfg file (section [lapack]) or by setting\n          the LAPACK environment variable.\n        return getattr(self, \'_calc_info_{}\'.format(name))()\n      lapack_src_info:\n        NOT AVAILABLE\n\n      C:\\Users\\_\\AppData\\Local\\Temp\\pip-install-12pl1k89\\numpy_a61d254ad189429092d1fab3dbdca78f\\numpy\\distutils\\system_info.py:1849: UserWarning:\n          Lapack (http://www.netlib.org/lapack/) sources not found.\n          Directories to search for the sources can be specified in the\n          numpy/distutils/site.cfg file (section [lapack_src]) or by setting\n          the LAPACK_SRC environment variable.\n        return getattr(self, \'_calc_info_{}\'.format(name))()\n        NOT AVAILABLE\n\n      numpy_linalg_lapack_lite:\n        FOUND:\n          language = c\n          define_macros = [(\'HAVE_BLAS_ILP64\', None), (\'BLAS_SYMBOL_SUFFIX\', \'64_\')]\n\n      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\'\n        warnings.warn(msg)\n      running dist_info\n      running build_src\n      build_src\n      building py_modules sources\n      creating build\n      creating build\\src.win-amd64-3.10\n      creating build\\src.win-amd64-3.10\\numpy\n      creating build\\src.win-amd64-3.10\\numpy\\distutils\n      building library "npymath" sources\n      LINK : fatal error LNK1104: cannot open file \'kernel32.lib\'\n      Traceback (most recent call last):\n        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>\n          main()\n        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\n          json_out[\'return_val\'] = hook(**hook_input[\'kwargs\'])\n        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\n          return hook(metadata_directory, config_settings)\n        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\n          self.run_setup()\n        File "C:\\Users\\_\\AppData\\Local\\Temp\\pip-build-env-fmnw10id\\overlay\\Lib\\site-packages\\setuptools\\build_meta.py", line 248, in run_setup\n          super(_BuildMetaLegacyBackend,\n        File "C:\\Users\\_\\AppData\\Local\\Temp\\pip-build-env-fmnw10id\\overlay\\Lib\\site-packages\\setuptools\\build_meta.py", line 142, in run_setup\n          exec(compile(code, __file__, \'exec\'), locals())\n        File "setup.py", line 513, in <module>\n          setup_package()\n        File "setup.py", line 505, in setup_package\n          setup(**metadata)\n        File "C:\\Users\\_\\AppData\\Local\\Temp\\pip-install-12pl1k89\\numpy_a61d254ad189429092d1fab3dbdca78f\\numpy\\distutils\\core.py", line 169, in setup\n          return old_setup(**new_attr)\n        File "C:\\Users\\_\\AppData\\Local\\Temp\\pip-build-env-fmnw10id\\overlay\\Lib\\site-packages\\setuptools\\__init__.py", line 165, in setup\n          return distutils.core.setup(**attrs)\n        File "C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.10_3.10.752.0_x64__qbz5n2kfra8p0\\lib\\distutils\\core.py", line 148, in setup\n          dist.run_commands()\n        File "C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.10_3.10.752.0_x64__qbz5n2kfra8p0\\lib\\distutils\\dist.py", line 966, in run_commands\n          self.run_command(cmd)\n        File "C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.10_3.10.752.0_x64__qbz5n2kfra8p0\\lib\\distutils\\dist.py", line 985, in run_command\n          cmd_obj.run()\n        File "C:\\Users\\_\\AppData\\Local\\Temp\\pip-build-env-fmnw10id\\overlay\\Lib\\site-packages\\setuptools\\command\\dist_info.py", line 31, in run\n          egg_info.run()\n        File "C:\\Users\\\\AppData\\Local\\Temp\\pip-install-12pl1k89\\numpy_a61d254ad189429092d1fab3dbdca78f\\numpy\\distutils\\command\\egg_info.py", line 24, in run\n          self.run_command("build_src")\n        File "C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.10_3.10.752.0_x64__qbz5n2kfra8p0\\lib\\distutils\\cmd.py", line 313, in run_command\n          self.distribution.run_command(command)\n        File "C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.10_3.10.752.0_x64__qbz5n2kfra8p0\\lib\\distutils\\dist.py", line 985, in run_command\n          cmd_obj.run()\n        File "C:\\Users\\_\\AppData\\Local\\Temp\\pip-install-12pl1k89\\numpy_a61d254ad189429092d1fab3dbdca78f\\numpy\\distutils\\command\\build_src.py", line 144, in run\n          self.build_sources()\n        File "C:\\Users\\_\\AppData\\Local\\Temp\\pip-install-12pl1k89\\numpy_a61d254ad189429092d1fab3dbdca78f\\numpy\\distutils\\command\\build_src.py", line 155, in build_sources\n          self.build_library_sources(*libname_info)\n        File "C:\\Users\\_\\AppData\\Local\\Temp\\pip-install-12pl1k89\\numpy_a61d254ad189429092d1fab3dbdca78f\\numpy\\distutils\\command\\build_src.py", line 288, in build_library_sources\n          sources = self.generate_sources(sources, (lib_name, build_info))\n        File "C:\\Users\\_\\AppData\\Local\\Temp\\pip-install-12pl1k89\\numpy_a61d254ad189429092d1fab3dbdca78f\\numpy\\distutils\\command\\build_src.py", line 378, in generate_sources\n          source = func(extension, build_dir)\n        File "numpy\\core\\setup.py", line 676, in get_mathlib_info\n          raise RuntimeError("Broken toolchain: cannot link a simple C program")\n      RuntimeError: Broken toolchain: cannot link a simple C program\n      [end of output]\n\n  note: This error originates from a subprocess, and is likely not a problem with pip.\nerror: metadata-generation-failed\n\n\xc3\x97 Encountered error while generating package metadata.\n\xe2\x95\xb0\xe2\x94\x80> See above for output.\n\nnote: This is an issue with the package mentioned above, not pip.\nhint: See above for details.\n
Run Code Online (Sandbox Code Playgroud)\n

我是这样安装的:

\n

(venv) PS C:\\Users_\\OneDrive\\Desktop\\VOR-Models\\2021-VOR-Model> pip install -r requests.txt

\n

因为我很迷茫,所以我给你看requirements.txt。这个函数实际上安装了 numpy 之前的所有内容,然后失败了。

\n
clearbeautifulsoup4==4.9.3\ncertifi==2021.5.30\nchardet==4.0.0\nidna==2.10\nnumpy==1.20.3\npandas==1.2.4\npython-dateutil==2.8.1\npytz==2021.1\nrequests==2.25.1\nsix==1.16.0\nsoupsieve==2.2.1\nurllib3==1.26.5\n
Run Code Online (Sandbox Code Playgroud)\n

任何帮助表示赞赏。我这样做的原因是因为我参加了在线课程(https://www.fantasyfootballdatapros.com/),并且正在尝试用 pandas 进行数据处理。为此我需要 NumPy。我也尝试查看其他问题,但他们没有给我我需要的答案,或者根本没有答案。请帮忙。

\n

小智 1

它在错误消息中说了这一点。

RuntimeWarning:NumPy 1.20.3 可能尚不支持 Python 3.10。

两次快速尝试:

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

蟒蛇-m numpy

  1. 尝试较低的 numpy 版本。在requirements.txt中尝试输入1.20.3以下的内容

numpy==1.19.2