使用python install命令超时消息

问题描述 投票:1回答:1

我正在尝试安装spacy'en_core_web_md'模型,但每当我尝试使用此python命令下载它时,我会得到超时消息:'python -m spacy download en_core_web_md'

错误信息:

  File "C:\ProgramData\Anaconda2\envs\tensorflow\lib\site-packages\pip\_vendor\r
equests\packages\urllib3\response.py", line 237, in _error_catcher
    raise ReadTimeoutError(self._pool, None, 'Read timed out.')
pip._vendor.requests.packages.urllib3.exceptions.ReadTimeoutError: HTTPSConnecti
onPool(host='github-production-release-asset-2e65be.s3.amazonaws.com', port=443)
: Read timed out.
python python-3.x tensorflow pip spacy
1个回答
1
投票

en_core_web_md模型是115 MB,因此根据您的互联网连接(以及GitHub的服务器,托管模型的位置),连接超时和下载失败总是会发生。

您也可以通过浏览器或任何其他方便的方式下载模型。您可以在单独的.tar.gz中找到model releases存档(只需单击要下载的模型上的“发布详细信息”按钮)。例如,here's the en_core_web_md release

模型是Python包,所以一旦你下载了文件,你只需通过pip安装它:

pip install /path/to/en_core_web_md-2.0.0.tar.gz

然后你可以像这样加载它:

nlp = spacy.load('en_core_web_md')
© www.soinside.com 2019 - 2024. All rights reserved.