【问题标题】:How to install fpdf in anaconda under python 3.7.x?python 3.7.x下如何在anaconda中安装fpdf?
【发布时间】:2020-03-19 02:59:47
【问题描述】:

我有一些统计结果想导出为 PDF 格式,我搜索了这个网站,似乎使用 FPDF 是一个不错的选择。

我在 Windows 10 下使用 Anaconda,在 Anaconda Prompt 中我输入了Anaconda clouds 中所示的代码:

conda install -c foxbms fpdf

但是出现错误,提示:

UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:

Specifications:

  - fpdf -> python[version='>=3.6,<3.7.0a0']

Your python: python=3.7

If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.

The following specifications were found to be incompatible with each other:



Package wincertstore conflicts for:
fpdf -> python[version='>=3.6,<3.7.0a0'] -> pip -> setuptools -> wincertstore[version='>=0.2']
python=3.7 -> pip -> setuptools -> wincertstore[version='>=0.2']
Package certifi conflicts for:
python=3.7 -> pip -> setuptools -> certifi[version='>=2016.09|>=2016.9.26']
fpdf -> python[version='>=3.6,<3.7.0a0'] -> pip -> setuptools -> certifi[version='>=2016.09|>=2016.9.26|>=2017.4.17']
Package wheel conflicts for:
fpdf -> python[version='>=3.6,<3.7.0a0'] -> pip -> wheel
python=3.7 -> pip -> wheel
Package setuptools conflicts for:
fpdf -> python[version='>=3.6,<3.7.0a0'] -> pip -> setuptools
python=3.7 -> pip -> setuptools
Package pip conflicts for:
fpdf -> python[version='>=3.6,<3.7.0a0'] -> pip
python=3.7 -> pip
Package ca-certificates conflicts for:
python=3.7 -> openssl[version='>=1.1.1a,<1.1.2a'] -> ca-certificates
fpdf -> python[version='>=3.6,<3.7.0a0'] -> pip -> requests -> urllib3[version='>=1.21.1,<1.24'] -> cryptography[version='>=1.3.4'] -> openssl[version='>=1.1.1a,<1.1.2a'] -> ca-certificates
Package msgpack-python conflicts for:
fpdf -> python[version='>=3.6,<3.7.0a0'] -> pip -> cachecontrol -> msgpack-python

是不是因为我3.7.4的python版本高于要求的3.6?

如果他们有任何安装 FPDF 的解决方案?

谢谢。如果这是一个愚蠢的问题,我深表歉意。

【问题讨论】:

  • 是的。这行python[version='&gt;=3.6,&lt;3.7.0a0'] 表示该包仅支持 Python 3.6。有很多 Python 包可以处理 pdf 导出,我相信你可以找到替代方案。
  • @orangeInk 谢谢,我会尝试找一些其他的包。

标签: python anaconda fpdf python-3.7


【解决方案1】:

我使用的是 Python 版本 Python 3.7.1,我在 Anaconda 命令提示符中输入了这个命令来安装 FPDF:

pip3 install fpdf

【讨论】:

    【解决方案2】:

    您好,您可以使用 pip,只需输入

    pip install fpdf2
    

    fpdf2 是 fpdf 的一个分支,支持 Python 3.6+,仍在开发中。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-06-29
      • 2019-12-02
      • 1970-01-01
      • 2018-12-09
      • 2023-02-21
      • 2019-11-28
      • 2021-01-09
      • 2020-05-18
      相关资源
      最近更新 更多