无法通过 pip 安装 RTF

unable to install rtf via pip

提问人:Dan 提问时间:10/9/2023 更新时间:10/9/2023 访问量:37

问:

尝试通过 pip 安装 rtf 并得到以下内容,

重新安装了 Python 并检查了 python 和 setuptools 是否为 UpToDate,但仍然收到相同的错误。

`C:\Users\Dell>pip install rtf
  Collecting rtf
 Using cached rtf-0.0.1-py3-none-any.whl (14 kB)
Collecting absl-py==0.7.1 (from rtf)
  Using cached absl-py-0.7.1.tar.gz (99 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

 × python setup.py egg_info did not run successfully.
 │ exit code: 1
 ╰─> [6 lines of output]
     Traceback (most recent call last):
       File "<string>", line 2, in <module>
       File "<pip-setuptools-caller>", line 34, in <module>
          File "C:\Users\Dell\AppData\Local\Temp\pip-install-v0_l0uum\absl-      py_cfabd528981b46f7aadc5bd0743d710e\setup.py", line 34, in <module>
       raise RuntimeError('Python version 2.7 or 3.4+ is required.')
       RuntimeError: Python version 2.7 or 3.4+ is required.
         [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.

注意:这是上面提到的软件包的问题,而不是 pip。 提示:有关详细信息,请参阅上文。

重新安装了 Python 并检查了 python 和 setuptools 是否为 UpToDate,但仍然收到相同的错误。

python pip rtf

评论

1赞 Marijn 10/9/2023
它说您的 Python 版本不受支持,这可能是原因。你的 Python 版本是什么?您可以通过从命令行启动 Python 来检查,然后在顶部打印版本。
1赞 rasjani 10/9/2023
rtf 拉入 absl-py 包 0.7.1,它有触发此错误的 setup.py - 这是特定版本的 absl 中的错误。仅供参考,@Marijn
0赞 phd 10/9/2023
stackoverflow.com/a/75250610/7976758

答: 暂无答案