Python ModuleNotFoundError:没有名为';天赋';
我已经通过以下命令安装了flair库Python ModuleNotFoundError:没有名为';天赋';,python,nlp,flair,Python,Nlp,Flair,我已经通过以下命令安装了flair库 !pip install flair 但当我尝试导入它时,它会生成类似“ModuleNotFoundError:没有名为'flair'的模块”的错误 代码: import torch import numpy as np from flair.data import Sentence from flair.embeddings import TransformerDocumentEmbeddings 通过以下命令安装请确保使用--user选项,否则在wi
!pip install flair
但当我尝试导入它时,它会生成类似“ModuleNotFoundError:没有名为'flair'的模块”的错误
代码:
import torch
import numpy as np
from flair.data import Sentence
from flair.embeddings import TransformerDocumentEmbeddings
通过以下命令安装请确保使用--user选项,否则在windows 10中会出现权限错误
!pip install --user flair
安装flair后,您必须在jupyter笔记本中重新启动内核是否运行了
pip列表| grep flair
并检查其是否已安装?是否已安装,我可以通过pip列表-->flair 0.8.0.POST1看到您的机器上可能安装了多个python/pip检查,安装后我需要重新启动内核,这解决了我的问题