在我的项目中,我有spaCy作为依赖项setup.py,但是我还想添加一个默认模型。
到目前为止,我的尝试是:
install_requires=['spacy', 'en_core_web_sm'],
dependency_links=['https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.0.0/en_core_web_sm-2.0.0.tar.gz#egg=en_core_web_sm'],
Run Code Online (Sandbox Code Playgroud)
在我的包中setup.py,但既包含pip install我的包裹的常规内容,也包含pip install --process-dependency-links回报:
pip._internal.exceptions.DistributionNotFound: No matching distribution found for en_core_web_sm (from mypackage==0.1)
Run Code Online (Sandbox Code Playgroud)
我从AllenAI找到了这个github问题,有同样的问题,没有解决方法。
请注意,如果pip install直接使用模型的url,它可以正常工作,但是当我的软件包使用安装时,我想将其安装为依赖项pip install。