如何在python 3.7.x下的anaconda中安装fpdf?

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

我有一些统计结果想要导出为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 anaconda fpdf python-3.7
3个回答
1
投票

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

pip install fpdf2

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


1
投票

我正在使用 Python 版本

Python 3.7.1
,并在 Anaconda 命令提示符中输入此命令来安装
FPDF

pip3 install fpdf

0
投票

从 fpdf 导入 FPDF

PDF类(FPDF): def 标头(自身): self.set_font('Arial', 'B', 12) self.cell(0, 10, '开斋节警报

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