Pin*_*ull 2 python conda pdfplumber
我正在尝试使用 miniconda3 安装 pdfplumber。我不断收到此错误消息,但我不知道如何解释它。
(env1) C:\Users\engineer>conda install -c conda-forge pdfplumber
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: -
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed
UnsatisfiableError: The following specifications were found to be incompatible with each other:
Output in format: Requested package -> Available versions
Note that strict channel priority may have removed packages required for satisfiability.
Run Code Online (Sandbox Code Playgroud)
还:
(env1) C:\Users\engineer>conda info
active environment : env1
active env location : C:\tools\miniconda3\envs\env1
shell level : 2
user config file : C:\Users\engineer\.condarc populated config files : C:\Users\engineer\.condarc
conda version : 4.10.3
conda-build version : not installed
python version : 3.8.10.final.0
virtual packages : __cuda=10.2=0
__win=0=0
__archspec=1=x86_64
base environment : C:\tools\miniconda3 (writable)
conda av data dir : C:\tools\miniconda3\etc\conda conda av metadata url : None
channel URLs : https://conda.anaconda.org/conda-forge/win-64
https://conda.anaconda.org/conda-forge/noarch
https://repo.anaconda.com/pkgs/main/win-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/win-64
https://repo.anaconda.com/pkgs/r/noarch
https://repo.anaconda.com/pkgs/msys2/win-64
https://repo.anaconda.com/pkgs/msys2/noarch
package cache : C:\tools\miniconda3\pkgs
C:\Users\engineer\.conda\pkgs
C:\Users\engineer\AppData\Local\conda\conda\pkgs
envs directories : C:\tools\miniconda3\envs
C:\Users\engineer\.conda\envs
C:\Users\engineer\AppData\Local\conda\conda\envs
platform : win-64
user-agent : conda/4.10.3 requests/2.26.0 CPython/3.8.10 Windows/10 Windows/10.0.18363
administrator : False
netrc file : None
offline mode : False
Run Code Online (Sandbox Code Playgroud)
使用 pip 不是一个选择,因为它绝对不能在我的公司代理后面工作,而 miniconda3 可以。
Conda 在识别不可满足性问题方面表现不佳的另一个例子。Mamba对此做得很好,识别出该imagemagick
软件包不适用于win-64平台:
$ CONDA_SUBDIR="win-64" mamba create -dn foo -c conda-forge pdfplumber\n\n __ __ __ __\n / \\ / \\ / \\ / \\\n / \\/ \\/ \\/ \\\n\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88/ /\xe2\x96\x88\xe2\x96\x88/ /\xe2\x96\x88\xe2\x96\x88/ /\xe2\x96\x88\xe2\x96\x88/ /\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\n / / \\ / \\ / \\ / \\ \\____\n / / \\_/ \\_/ \\_/ \\ o \\__,\n / _/ \\_____/ `\n |/\n \xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x95\x97 \xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x95\x97 \xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x95\x97 \xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x95\x97 \xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x95\x97\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x95\x97 \xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x95\x97\n \xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x95\x97 \xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x95\x91\xe2\x96\x88\xe2\x96\x88\xe2\x95\x94\xe2\x95\x90\xe2\x95\x90\xe2\x96\x88\xe2\x96\x88\xe2\x95\x97\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x95\x97 \xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x95\x91\xe2\x96\x88\xe2\x96\x88\xe2\x95\x94\xe2\x95\x90\xe2\x95\x90\xe2\x96\x88\xe2\x96\x88\xe2\x95\x97\xe2\x96\x88\xe2\x96\x88\xe2\x95\x94\xe2\x95\x90\xe2\x95\x90\xe2\x96\x88\xe2\x96\x88\xe2\x95\x97\n \xe2\x96\x88\xe2\x96\x88\xe2\x95\x94\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x95\x94\xe2\x96\x88\xe2\x96\x88\xe2\x95\x91\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x95\x91\xe2\x96\x88\xe2\x96\x88\xe2\x95\x94\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x95\x94\xe2\x96\x88\xe2\x96\x88\xe2\x95\x91\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x95\x94\xe2\x95\x9d\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x95\x91\n \xe2\x96\x88\xe2\x96\x88\xe2\x95\x91\xe2\x95\x9a\xe2\x96\x88\xe2\x96\x88\xe2\x95\x94\xe2\x95\x9d\xe2\x96\x88\xe2\x96\x88\xe2\x95\x91\xe2\x96\x88\xe2\x96\x88\xe2\x95\x94\xe2\x95\x90\xe2\x95\x90\xe2\x96\x88\xe2\x96\x88\xe2\x95\x91\xe2\x96\x88\xe2\x96\x88\xe2\x95\x91\xe2\x95\x9a\xe2\x96\x88\xe2\x96\x88\xe2\x95\x94\xe2\x95\x9d\xe2\x96\x88\xe2\x96\x88\xe2\x95\x91\xe2\x96\x88\xe2\x96\x88\xe2\x95\x94\xe2\x95\x90\xe2\x95\x90\xe2\x96\x88\xe2\x96\x88\xe2\x95\x97\xe2\x96\x88\xe2\x96\x88\xe2\x95\x94\xe2\x95\x90\xe2\x95\x90\xe2\x96\x88\xe2\x96\x88\xe2\x95\x91\n \xe2\x96\x88\xe2\x96\x88\xe2\x95\x91 \xe2\x95\x9a\xe2\x95\x90\xe2\x95\x9d \xe2\x96\x88\xe2\x96\x88\xe2\x95\x91\xe2\x96\x88\xe2\x96\x88\xe2\x95\x91 \xe2\x96\x88\xe2\x96\x88\xe2\x95\x91\xe2\x96\x88\xe2\x96\x88\xe2\x95\x91 \xe2\x95\x9a\xe2\x95\x90\xe2\x95\x9d \xe2\x96\x88\xe2\x96\x88\xe2\x95\x91\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x95\x94\xe2\x95\x9d\xe2\x96\x88\xe2\x96\x88\xe2\x95\x91 \xe2\x96\x88\xe2\x96\x88\xe2\x95\x91\n \xe2\x95\x9a\xe2\x95\x90\xe2\x95\x9d \xe2\x95\x9a\xe2\x95\x90\xe2\x95\x9d\xe2\x95\x9a\xe2\x95\x90\xe2\x95\x9d \xe2\x95\x9a\xe2\x95\x90\xe2\x95\x9d\xe2\x95\x9a\xe2\x95\x90\xe2\x95\x9d \xe2\x95\x9a\xe2\x95\x90\xe2\x95\x9d\xe2\x95\x9a\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x9d \xe2\x95\x9a\xe2\x95\x90\xe2\x95\x9d \xe2\x95\x9a\xe2\x95\x90\xe2\x95\x9d\n\n mamba (0.15.2) supported by @QuantStack\n\n GitHub: https://github.com/mamba-org/mamba\n Twitter: https://twitter.com/QuantStack\n\n\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\n\n\nLooking for: [\'pdfplumber\']\n\nbioconda/win-64 [====================] (00m:00s) No change\npkgs/main/noarch [====================] (00m:00s) Done\npkgs/r/win-64 [====================] (00m:00s) Done\npkgs/r/noarch [====================] (00m:00s) No change\npkgs/main/win-64 [====================] (00m:00s) Done\nbioconda/noarch [====================] (00m:01s) Done\nconda-forge/noarch [====================] (00m:01s) Done\nconda-forge/win-64 [====================] (00m:02s) Done\nEncountered problems while solving:\n - nothing provides imagemagick needed by wand-0.5.6-py_0\n
Run Code Online (Sandbox Code Playgroud)\n它应该可以在您的系统上本地安装 ImageMagick,并确保可以从命令行访问它。然后,您可以创建一个包含强制安装的wand
软件包的环境,这是唯一依赖于 ImageMagick 的软件包。
以下是创建环境的步骤(my_env
如下所示,但可以根据您的意愿命名):
## create the environment with python (I think you can use 3.6+)\nconda create -n my_env python=3.9\n\n## force-install "wand"\nconda install -n my_env --no-deps wand=0.6.5\n\n## install pdfplumber\nconda install -n my_env pdfplumber\n\n## try using the environment\nconda activate my_env\n
Run Code Online (Sandbox Code Playgroud)\n不需要 ImageMagick。从技术上讲, ImageMagick 似乎仅用于pdfplumber 的“可视化调试”功能。如果您不需要它,那么您可以完全放弃安装 ImageMagick。我验证(在osx-64上),没有 ImageMagick 的上述环境可以运行 CLI 示例和 pdfplumber 文档中的第一个 Python API 示例。
\n使用隔离环境。由于强制安装可能很危险(请阅读标志conda install --help
上的内容--no-deps
),因此我强烈建议为此创建一个专用环境,如上所示。
为什么要固定wand
版本?我指定了一个版本,wand
因为这将有助于防止 Conda 在将来更新时尝试更改它。
曼巴太棒了 我强烈推荐使用曼巴。安装很简单:
\nconda install -n base -c conda-forge mamba\n
Run Code Online (Sandbox Code Playgroud)\n然后mamba
只要您通常键入即可使用(和命令conda
除外)。conda activate
conda deactivate