使用pip install安装时出错

问题描述 投票:0回答:1

我在 Windows Poweshell 中尝试使用

pip install pandas==1.1.4
安装 Python 项目的依赖项时遇到问题。然后我得到了如下图所示的错误:

enter image description here

DEPRECATION: Loading egg at d:\data analyst\github\lokalhangatt\pacmann - git\minggu_4\4. advanced data manipulation\pertemuan 8 - data preprocessing pipeline\virenv_preprocessing\lib\site-packages\seaborn-0.11.0-py3.12.egg is deprecated. pip 25.1 will enforce this behaviour change. A possible replacement is to use pip for package installation. Discussion can be found at https://github.com/pypa/pip/issues/12330
Collecting pandas==1.1.4
  Downloading pandas-1.1.4.tar.gz (5.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.2/5.2 MB 491.1 kB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [32 lines of output]
      <string>:19: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
      <string>:45: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
      Traceback (most recent call last):
        File "D:\Data Analyst\Github\lokalhangatt\Pacmann - Git\Minggu_4\4. ADVANCED DATA MANIPULATION\Pertemuan 8 - Data Preprocessing Pipeline\virenv_preprocessing\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "D:\Data Analyst\Github\lokalhangatt\Pacmann - Git\Minggu_4\4. ADVANCED DATA MANIPULATION\Pertemuan 8 - Data Preprocessing Pipeline\virenv_preprocessing\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "D:\Data Analyst\Github\lokalhangatt\Pacmann - Git\Minggu_4\4. ADVANCED DATA MANIPULATION\Pertemuan 8 - Data Preprocessing Pipeline\virenv_preprocessing\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-zwgg3cb7\overlay\Lib\site-packages\setuptools\build_meta.py", line 334, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-zwgg3cb7\overlay\Lib\site-packages\setuptools\build_meta.py", line 304, in _get_build_requires
          self.run_setup()
        File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-zwgg3cb7\overlay\Lib\site-packages\setuptools\build_meta.py", line 522, in run_setup
          super().run_setup(setup_script=setup_script)
        File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-zwgg3cb7\overlay\Lib\site-packages\setuptools\build_meta.py", line 320, in run_setup
          exec(code, locals())
        File "<string>", line 792, in <module>
        File "<string>", line 759, in setup_package
        File "C:\Users\Administrator\AppData\Local\Temp\pip-install-um_nsy30\pandas_cfb0da7acd094bb49eb02e9b0460de24\versioneer.py", line 1439, in get_version
          return get_versions()["version"]
                 ^^^^^^^^^^^^^^
        File "C:\Users\Administrator\AppData\Local\Temp\pip-install-um_nsy30\pandas_cfb0da7acd094bb49eb02e9b0460de24\versioneer.py", line 1368, in get_versions
          cfg = get_config_from_root(root)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Administrator\AppData\Local\Temp\pip-install-um_nsy30\pandas_cfb0da7acd094bb49eb02e9b0460de24\versioneer.py", line 400, in get_config_from_root
          parser = configparser.SafeConfigParser()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      AttributeError: module 'configparser' has no attribute 'SafeConfigParser'. Did you mean: 'RawConfigParser'?
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

它这么说

the error originates from a subprocess, and is likely not a problem with pip
。但我不明白这是什么意思。

python pip virtualenv python-venv pyvenv
1个回答
0
投票

您收到弃用警告和后续错误消息,因为您尝试使用不受支持的 python 版本安装此软件包的旧版本。

您似乎使用的是 Python 3.12(从警告中可以看出),但是 pandas 1.1.4 与 python 3.6 - 3.9 兼容。

解决此问题的一种方法是安装支持 python 3.12 的稳定版本的 pandas,或者如果您必须使用旧版本,请将 python 降级到上述任何受支持的版本。

© www.soinside.com 2019 - 2024. All rights reserved.