我正在尝试添加pytorch_pretrained_bert包,但它在下载torch时挂起。我已经等了快30分钟了。我运行这个命令:poetry add pytorch_pretrained_bert -vvv,输出如下:
PS C:\Users\aaaa\Desktop\AI\nexus\ocr> poetry add pytorch_pretrained_bert -vvv
Using virtualenv: C:\Users\aaaa\AppData\Local\pypoetry\Cache\virtualenvs\ocr-MxNkBiZL-py3.8
PyPI: 10 packages found for pytorch-pretrained-bert *
Using version ^0.6.2 for pytorch-pretrained-bert
Updating dependencies
Resolving dependencies...
1: fact: ocr is 0.1.0
1: derived: ocr
1: fact: ocr depends on click (^8.0.1)
1: fact: ocr depends on pytesseract (^0.3.8)
1: fact: ocr depends on opencv-contrib-python (^4.5.2)
1: fact: ocr depends on numpy (^1.21.0)
1: fact: ocr depends on pdf2image (^1.16.0)
1: fact: ocr depends on poppler-utils (^0.1.0)
1: fact: ocr depends on deskew (^0.10.30)
1: fact: ocr depends on pytorch-pretrained-bert (^0.6.2)
1: fact: ocr depends on pytest (^5.2)
1: fact: ocr depends on pytest (^5.2)
1: selecting ocr (0.1.0)
1: derived: pytest (>=5.2,<6.0)
1: derived: pytorch-pretrained-bert (>=0.6.2,<0.7.0)
1: derived: deskew (>=0.10.30,<0.11.0)
1: derived: poppler-utils (>=0.1.0,<0.2.0)
1: derived: pdf2image (>=1.16.0,<2.0.0)
1: derived: numpy (>=1.21.0,<2.0.0)
1: derived: opencv-contrib-python (>=4.5.2,<5.0.0)
1: derived: pytesseract (>=0.3.8,<0.4.0)
1: derived: click (>=8.0.1,<9.0.0)
1: fact: pytest (5.4.3) depends on py (>=1.5.0)
1: fact: pytest (5.4.3) depends on packaging (*)
1: fact: pytest (5.4.3) depends on attrs (>=17.4.0)
1: fact: pytest (5.4.3) depends on more-itertools (>=4.0.0)
1: fact: pytest (5.4.3) depends on pluggy (>=0.12,<1.0)
1: fact: pytest (5.4.3) depends on wcwidth (*)
1: fact: pytest (5.4.3) depends on atomicwrites (>=1.0)
1: fact: pytest (5.4.3) depends on colorama (*)
1: selecting pytest (5.4.3)
1: derived: colorama
1: derived: atomicwrites (>=1.0)
1: derived: wcwidth
1: derived: pluggy (>=0.12,<1.0)
1: derived: more-itertools (>=4.0.0)
1: derived: attrs (>=17.4.0)
1: derived: packaging
1: derived: py (>=1.5.0)
PyPI: 1 packages found for pytorch-pretrained-bert >=0.6.2,<0.7.0
1: fact: pytorch-pretrained-bert (0.6.2) depends on torch (>=0.4.1)
1: fact: pytorch-pretrained-bert (0.6.2) depends on numpy (*)
1: fact: pytorch-pretrained-bert (0.6.2) depends on boto3 (*)
1: fact: pytorch-pretrained-bert (0.6.2) depends on requests (*)
1: fact: pytorch-pretrained-bert (0.6.2) depends on tqdm (*)
1: fact: pytorch-pretrained-bert (0.6.2) depends on regex (*)
1: selecting pytorch-pretrained-bert (0.6.2)
1: derived: regex
1: derived: tqdm
1: derived: requests
1: derived: boto3
1: derived: torch (>=0.4.1)
1: fact: deskew (0.10.30) depends on numpy (*)
1: fact: deskew (0.10.30) depends on scikit-image (!=0.15.0)
1: selecting deskew (0.10.30)
1: derived: scikit-image (!=0.15.0)
1: fact: poppler-utils (0.1.0) depends on Click (>=7.0)
1: selecting poppler-utils (0.1.0)
1: fact: pdf2image (1.16.0) depends on pillow (*)
1: selecting pdf2image (1.16.0)
1: derived: pillow
1: selecting numpy (1.21.0)
1: fact: opencv-contrib-python (4.5.2.54) depends on numpy (>=1.13.3)
1: selecting opencv-contrib-python (4.5.2.54)
1: fact: pytesseract (0.3.8) depends on Pillow (*)
1: selecting pytesseract (0.3.8)
1: fact: click (8.0.1) depends on colorama (*)
1: selecting click (8.0.1)
1: selecting wcwidth (0.2.5)
1: selecting pluggy (0.13.1)
1: selecting more-itertools (8.8.0)
1: selecting attrs (21.2.0)
1: fact: packaging (21.0) depends on pyparsing (>=2.0.2)
1: selecting packaging (21.0)
1: derived: pyparsing (>=2.0.2)
1: selecting py (1.10.0)
1: selecting regex (2021.7.6)
1: fact: tqdm (4.61.2) depends on colorama (*)
1: selecting tqdm (4.61.2)
1: fact: requests (2.25.1) depends on chardet (>=3.0.2,<5)
1: fact: requests (2.25.1) depends on idna (>=2.5,<3)
1: fact: requests (2.25.1) depends on urllib3 (>=1.21.1,<1.27)
1: fact: requests (2.25.1) depends on certifi (>=2017.4.17)
1: selecting requests (2.25.1)
1: derived: certifi (>=2017.4.17)
1: derived: urllib3 (>=1.21.1,<1.27)
1: derived: idna (>=2.5,<3)
1: derived: chardet (>=3.0.2,<5)
1: fact: boto3 (1.17.105) depends on botocore (>=1.20.105,<1.21.0)
1: fact: boto3 (1.17.105) depends on jmespath (>=0.7.1,<1.0.0)
1: fact: boto3 (1.17.105) depends on s3transfer (>=0.4.0,<0.5.0)
1: selecting boto3 (1.17.105)
1: derived: s3transfer (>=0.4.0,<0.5.0)
1: derived: jmespath (>=0.7.1,<1.0.0)
1: derived: botocore (>=1.20.105,<1.21.0)
1: fact: torch (1.9.0) depends on typing-extensions (*)
1: selecting torch (1.9.0)
1: derived: typing-extensions
1: fact: scikit-image (0.18.2) depends on numpy (>=1.16.5)
1: fact: scikit-image (0.18.2) depends on scipy (>=1.0.1)
1: fact: scikit-image (0.18.2) depends on matplotlib (>=2.0.0,<3.0.0 || >3.0.0)
1: fact: scikit-image (0.18.2) depends on networkx (>=2.0)
1: fact: scikit-image (0.18.2) depends on pillow (>=4.3.0,<7.1.0 || >7.1.0,<7.1.1 || >7.1.1)
1: fact: scikit-image (0.18.2) depends on imageio (>=2.3.0)
1: fact: scikit-image (0.18.2) depends on tifffile (>=2019.7.26)
1: fact: scikit-image (0.18.2) depends on PyWavelets (>=1.1.1)
1: selecting scikit-image (0.18.2)
1: derived: PyWavelets (>=1.1.1)
1: derived: tifffile (>=2019.7.26)
1: derived: imageio (>=2.3.0)
1: derived: pillow (>=4.3.0,!=7.1.0,!=7.1.1)
1: derived: networkx (>=2.0)
1: derived: matplotlib (>=2.0.0,!=3.0.0)
1: derived: scipy (>=1.0.1)
1: selecting pillow (8.3.0)
1: selecting pyparsing (2.4.7)
1: selecting certifi (2021.5.30)
1: selecting urllib3 (1.26.6)
1: selecting idna (2.10)
1: selecting chardet (4.0.0)
1: fact: s3transfer (0.4.2) depends on botocore (>=1.12.36,<2.0a.0)
1: selecting s3transfer (0.4.2)
1: selecting jmespath (0.10.0)
1: fact: botocore (1.20.105) depends on jmespath (>=0.7.1,<1.0.0)
1: fact: botocore (1.20.105) depends on python-dateutil (>=2.1,<3.0.0)
1: fact: botocore (1.20.105) depends on urllib3 (>=1.25.4,<1.27)
1: selecting botocore (1.20.105)
1: derived: python-dateutil (>=2.1,<3.0.0)
1: selecting typing-extensions (3.10.0.0)
1: fact: pywavelets (1.1.1) depends on numpy (>=1.13.3)
1: selecting pywavelets (1.1.1)
1: fact: tifffile (2021.7.2) depends on numpy (>=1.15.1)
1: selecting tifffile (2021.7.2)
1: fact: imageio (2.9.0) depends on numpy (*)
1: fact: imageio (2.9.0) depends on pillow (*)
1: selecting imageio (2.9.0)
1: fact: networkx (2.5.1) depends on decorator (>=4.3,<5)
1: selecting networkx (2.5.1)
1: derived: decorator (>=4.3,<5)
1: fact: matplotlib (3.4.2) depends on cycler (>=0.10)
1: fact: matplotlib (3.4.2) depends on kiwisolver (>=1.0.1)
1: fact: matplotlib (3.4.2) depends on numpy (>=1.16)
1: fact: matplotlib (3.4.2) depends on pillow (>=6.2.0)
1: fact: matplotlib (3.4.2) depends on pyparsing (>=2.2.1)
1: fact: matplotlib (3.4.2) depends on python-dateutil (>=2.7)
1: selecting matplotlib (3.4.2)
1: derived: python-dateutil (>=2.7)
1: derived: kiwisolver (>=1.0.1)
1: derived: cycler (>=0.10)
1: fact: scipy (1.6.1) depends on numpy (>=1.16.5)
1: selecting scipy (1.6.1)
1: fact: python-dateutil (2.8.1) depends on six (>=1.5)
1: selecting python-dateutil (2.8.1)
1: derived: six (>=1.5)
1: selecting decorator (4.4.2)
1: selecting kiwisolver (1.3.1)
1: fact: cycler (0.10.0) depends on six (*)
1: selecting cycler (0.10.0)
1: selecting six (1.16.0)
1: selecting colorama (0.4.4)
1: selecting atomicwrites (1.4.0)
1: Version solving took 0.246 seconds.
1: Tried 1 solutions.
Finding the necessary packages for the current system
Package operations: 2 installs, 0 updates, 0 removals, 42 skipped
• Installing six (1.16.0): Skipped for the following reason: Already installed
• Installing jmespath (0.10.0): Skipped for the following reason: Already installed
• Installing python-dateutil (2.8.1): Skipped for the following reason: Already installed
• Installing urllib3 (1.26.6): Skipped for the following reason: Already installed
• Installing botocore (1.20.105): Skipped for the following reason: Already installed
• Installing cycler (0.10.0): Skipped for the following reason: Already installed
• Installing kiwisolver (1.3.1): Skipped for the following reason: Already installed
• Installing pillow (8.3.0): Skipped for the following reason: Already installed
• Installing decorator (4.4.2): Skipped for the following reason: Already installed
• Installing numpy (1.21.0): Skipped for the following reason: Already installed
• Installing pyparsing (2.4.7): Skipped for the following reason: Already installed
• Installing certifi (2021.5.30): Skipped for the following reason: Already installed
• Installing chardet (4.0.0): Skipped for the following reason: Already installed
• Installing imageio (2.9.0): Skipped for the following reason: Already installed
• Installing networkx (2.5.1): Skipped for the following reason: Already installed
• Installing colorama (0.4.4): Skipped for the following reason: Already installed
• Installing scipy (1.6.1): Skipped for the following reason: Already installed
• Installing pywavelets (1.1.1): Skipped for the following reason: Already installed
• Installing matplotlib (3.4.2): Skipped for the following reason: Already installed
• Installing tifffile (2021.7.2): Skipped for the following reason: Already installed
• Installing typing-extensions (3.10.0.0): Skipped for the following reason: Already installed
• Installing s3transfer (0.4.2): Skipped for the following reason: Already installed
• Installing idna (2.10): Skipped for the following reason: Already installed
• Installing atomicwrites (1.4.0): Skipped for the following reason: Already installed
• Installing attrs (21.2.0): Skipped for the following reason: Already installed
• Installing click (8.0.1): Skipped for the following reason: Already installed
• Installing packaging (21.0): Skipped for the following reason: Already installed
• Installing more-itertools (8.8.0): Skipped for the following reason: Already installed
• Installing boto3 (1.17.105): Skipped for the following reason: Already installed
• Installing py (1.10.0): Skipped for the following reason: Already installed
• Installing requests (2.25.1): Skipped for the following reason: Already installed
• Installing scikit-image (0.18.2): Skipped for the following reason: Already installed
• Installing wcwidth (0.2.5): Skipped for the following reason: Already installed
• Installing tqdm (4.61.2): Skipped for the following reason: Already installed
• Installing torch (1.9.0)
• Installing pluggy (0.13.1): Skipped for the following reason: Already installed
• Installing regex (2021.7.6): Skipped for the following reason: Already installed如您所见,安装尚未完成。可能的原因是什么?我正在使用Windows10操作系统,并在Windows PowerShell中运行该命令。
发布于 2021-10-27 19:28:13
TL;DR:这很容易通过绿色的版本号和点 或运行 poetry run <package> --version 并成功输出来验证。
简短的回答
当我安装了带有Poetry的软件包时,我看到一些软件包,比如pylint,只显示一行
Installing pylint (2.11.1)似乎永远不会完成。但如果我参选
poetry run pylint --version它将打印出诗歌venv中的已安装版本:
pylint 2.11.1
astroid 2.8.3
Python 3.9.7 (default, Sep 3 2021, ...)更长的答案
不确定这是否是诗歌的最新变化,但目前使用的是诗歌的预览版1.2.0a2,运行poetry add <package> -vvv后的输出看起来像这样,以指示单独解析依赖项和安装进度:
$ poetry add pylint -vvv
Loading configuration file ...
Using virtualenv: ...
PyPI: 1 packages found for pylint
Updating dependencies
Resolving dependencies...
1: fact: pylint (2.11.1) depends on platformdirs (>=2.2.0)
1: fact: pylint (2.11.1) depends on astroid (>=2.8.0,<2.9)
1: fact: pylint (2.11.1) depends on isort (>=4.2.5,<6)
1: fact: pylint (2.11.1) depends on mccabe (>=0.6,<0.7)
1: fact: pylint (2.11.1) depends on toml (>=0.7.1)
1: fact: pylint (2.11.1) depends on typing-extensions (>=3.10.0)
1: fact: pylint (2.11.1) depends on colorama (*)
1: selecting pylint (2.11.1)
1: derived: typing-extensions (>=3.10.0)
1: derived: toml (>=0.7.1)
1: derived: mccabe (>=0.6,<0.7)
1: derived: isort (>=4.2.5,<6)
1: derived: astroid (>=2.8.0,<2.9)
1: derived: platformdirs (>=2.2.0)
PyPI: 1 packages found for pylint
...
Writing lock file
Finding the necessary packages for the current system
Package operations: 6 installs, 0 updates, 0 removals, 0 skipped
• Installing pylint (2.11.1): Pending...
• Installing pytest (2.11.1): Installing...
• Installing pytest (2.11.1) # dot and version will be green to indicate package was installed请注意,输出最初将作为Pending...开始,并可能将行更新为Downloading X%,然后更新为Installing...或新行上的输出。因此,如果您看到一行本身,则可能已经安装了该软件包。可以通过绿色的版本号和点as shown in this screenshot或运行poetry run <package> --version并成功输出来验证这一点。
希望这个额外的输出能够澄清您正在安装的软件包的安装状态。
https://stackoverflow.com/questions/68270223
复制相似问题