Python 安装Flair(NLP库)时出错

Python 安装Flair(NLP库)时出错,python,cmd,installation,pip,pytorch,Python,Cmd,Installation,Pip,Pytorch,我正在尝试使用pip安装NLP库“Flair”,并收到错误消息: ERROR: Could not find a version that satisfies the requirement torch>=1.0.0 (from flair) (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2) ERROR: No matching distribution found for torch>=1.0.0 (from flair)" 我该怎

我正在尝试使用pip安装NLP库“Flair”,并收到错误消息:

ERROR: Could not find a version that satisfies the requirement torch>=1.0.0 (from flair) (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2)
ERROR: No matching distribution found for torch>=1.0.0 (from flair)"
我该怎么办

我正在使用python3.6,并尝试在virtualenv中使用cmd和pip安装flair。但是仍然有错误消息

(env) C:\Users\HP>pip install flair

我希望安装没有任何问题。

Pytorch或torch当前无法在windows中使用pypi安装。 您需要conda来完成以下任务:

conda install pytorch torchvision cudatoolkit=9.0 -c pytorch

对于较旧的torch版本,您可以使用whl文件,Cuda版本可以是8.0,9.0,10.0

pip install torch==1.0.1 -f https://download.pytorch.org/whl/cu90/stable # CUDA 9.0 build

我通过安装以下软件包解决了这个问题:

!pip install tiny-tokenizer flair

我也遇到了同样的错误

以下步骤在Windows10、Python3.6上对我有效

1.按照制造商的官方安装说明安装Pytorch,并有详细的文件记录

根据您选择的软件包[pip/conda等]和操作系统[Mac/Linus/Windows],它将提供命令。 此链接提供了有关如何安装pytorch的有用详细信息-

2.成功安装pytorch后,只需使用命令安装Flair即可
pip安装flair

升级您的pip,然后重试

pip install --upgrade pip
pip install torch

pip安装火炬