错误如下-
Collecting pandas~=0.24.0 (from google-colab)
Using cached pandas-0.24.2.tar.gz (11.8 MB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [18 lines of output]
C:\Users\mkpan\AppData\Local\Temp\pip-install-j73lpax3\pandas_935025fbfe6c48039f7095432e24aeb1\setup.py:12: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import pkg_resources
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\mkpan\AppData\Local\Temp\pip-install-j73lpax3\pandas_935025fbfe6c48039f7095432e24aeb1\setup.py", line 732, in <module>
version=versioneer.get_version(),
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\mkpan\AppData\Local\Temp\pip-install-j73lpax3\pandas_935025fbfe6c48039f7095432e24aeb1\versioneer.py", line 1409, in get_version
return get_versions()["version"]
^^^^^^^^^^^^^^
File "C:\Users\mkpan\AppData\Local\Temp\pip-install-j73lpax3\pandas_935025fbfe6c48039f7095432e24aeb1\versioneer.py", line 1343, in get_versions
cfg = get_config_from_root(root)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\mkpan\AppData\Local\Temp\pip-install-j73lpax3\pandas_935025fbfe6c48039f7095432e24aeb1\versioneer.py", line 399, 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: 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.
我什至单独安装了 pandas 并且它可以工作,但是当我尝试下载 google.colab 或 google-colab 时它会抛出此错误
你能帮我吗?
以下是错误和潜在解决方案的细分:
错误分析:
google-colab
的依赖。configparser
有关。在较旧的 Python 版本(3.2 之前)中,SafeConfigParser
可用,但在新版本中已重命名为 RawConfigParser
。故障排除步骤:
升级Python:如果可能,请升级到Python 3.2或更高版本,以确保与
configparser
兼容。
地址
configparser
问题:
configparser
:
python -m pip install --upgrade configparser
versioneer.py
(位于 pandas 安装目录中)中的行以使用 RawConfigParser
而不是 SafeConfigParser
。干净的安装环境:
python -m pip cache purge
python -m pip install --upgrade --force-reinstall pandas
尝试其他安装方法:
conda
(如果有):conda install -c conda-forge google-colab
google-colab
源代码并按照其安装说明进行操作。检查特定版本冲突:
google-colab
任何特定 pandas 版本要求的文档。==
而不是 ~=
安装兼容的 pandas 版本。