pip 安装二进制文件并保留要求.txt



我正在制作一个依赖于spacy的 Python 包。Spacy使用二进制语言模型。所以我在requirements.txt末尾列出了 URL

https://github.com/explosion/spacy-models/releases/download/es_core_news_sm-2.0.0/es_core_news_sm-2.0.0.tar.gz#egg=spacy-english-model

但是,如果我freeze环境,则软件包不会出现与下载 URL 一起出现:

spacy-english-model==2.0.0

因此,如果我添加一个包,我无法pip install它然后pip freeze.如何在requirements.txt中指定包,以便在freeze时显示其 URL?

您不需要使用 pip freeze 来分发您的软件包。编写包时,您需要根据如下文档在requirements.txt文件中添加模型:

https://github.com/explosion/spacy-models/releases/download/es_core_news_sm-2.0.0/es_core_news_sm-2.0.0.tar.gz

你可以看到这里发生了(检查dev-requirements.txt(

我不知道pip freeze从哪里得到spacy-english-model。我会从一个新的python virtualenv开始,然后再次测试所有内容。

最新更新