先来介绍一下背景吧,我在学习一份关于附在一份文献上的源码,因为需要stanfordnlp包,所以我就想着安装一下。本来认为挺简单的一件事情,结果花费了好久的时间。所以写篇文章记录一下。
我使用的是pip来安装stanfordnlp,然后有如下图的错误提示:
简单来说就是找不到匹配的torch版本
试用了很多的方法,最后解决方法是:
首先,pip3 install torch===1.3.1 torchvision===0.4.2 -f
https://download.pytorch.org/whl/torch_stable.html
接着,pip install stanfordnlp
大功告成,亲测有效