python - 安装基于 pyproject.toml 的项目所需的错误 : Could not build wheels for pandas,

标签 python pandas installation pip

我正在尝试通过笔记本电脑上的 pip install pandas 安装 pandas。

环境:

  • Windows 11 专业版
  • python 3.10.4
  • pip 版本 22.0.4

兼容性:

C:\Users\PC>pip install pandas
WARNING: Ignoring invalid distribution -ywin32 (c:\users\pc\appdata\local\programs\python\python310-32\lib\site-packages)
WARNING: Ignoring invalid distribution -ywin32 (c:\users\pc\appdata\local\programs\python\python310-32\lib\site-packages)
Collecting pandas
  Using cached pandas-1.4.2.tar.gz (4.9 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy>=1.21.0 in c:\users\pc\appdata\local\programs\python\python310-32\lib\site-packages (from pandas) (1.22.4)
Requirement already satisfied: python-dateutil>=2.8.1 in c:\users\pc\appdata\local\programs\python\python310-32\lib\site-packages (from pandas) (2.8.2)
Collecting pytz>=2020.1
  Using cached pytz-2022.1-py2.py3-none-any.whl (503 kB)
Requirement already satisfied: six>=1.5 in c:\users\pc\appdata\local\programs\python\python310-32\lib\site-packages (from python-dateutil>=2.8.1->pandas) (1.16.0)
Building wheels for collected packages: pandas
  Building wheel for pandas (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for pandas (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [2010 lines of output]
      C:\Users\PC\AppData\Local\Temp\pip-build-env-q3kdt5nb\overlay\Lib\site-packages\setuptools\config\setupcfg.py:459: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)

...

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pandas
Failed to build pandas
ERROR: Could not build wheels for pandas, which is required to install pyproject.toml-based projects

我尝试过的:

  • 更新 pip 到 22.1.1
  • 安装轮子0.37.1
  • 卸载并安装 pip
  • 已卸载并安装 python 3.10.4

使用 pandas 1.5.1 仍可重现错误


感谢@ AKX它指出 future 没有也可能不会有 32 位版本的 pandas。 See the discussion on GitHub .

最佳答案

Pandas 不需要 Anaconda 即可工作,但根据输出中的 python310-32,您使用的是 32 位版本的 Python。

Pandas evidently不为 Python 3.10 提供 32 位轮子(尽管它们有用于 Python 3.8 和 Python 3.9 的 win32 轮子)。 (可能有预制 32 位轮子的替代来源,例如 Gohlke's site 。)

换句话说,在该平台上,您需要从源代码安装 Pandas,这可能是一项相当困难的工作,而且无论如何都不能直接在 pip 中完成(正如您通过错误:元数据生成失败)。

如果您的系统能够运行 64 位 Python,您应该切换到它。

关于python - 安装基于 pyproject.toml 的项目所需的错误 : Could not build wheels for pandas,,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72401377/

相关文章:

python - Unicode解码错误: ('utf-8' codec) while reading a dta file in Pandas

python - 在 CentOS 上安装 M2Crypto

python - Apache mpm 事件共享内存错误 - 打开输出流编码器时出现 ffmpeg-python 错误 #0 :1 when accessed by multiple instances

python - Pandas - 在 Na 以外的值上使用 'ffill'

Python/Pandas 删除包含特定字符串的字符串的开头

symfony - 哪个目录更适合安装 Symfony 项目?

installation - 如何将默认安装目录更改为用户主目录(在 Windows 上)。?

python - django mssql 安装程序 : error initializing DB

python - Python if语句 “SyntaxError: invalid syntax”

python - pandas 将行数据转换为列数据