【发布时间】:2021-02-05 11:04:22
【问题描述】:
根据我的研究,以下应该有效:
from setuptools import setup
from setuptools import find_packages
...
REQUIRES_INSTALL = [
'spacy==2.3.2',
'tensorflow==1.14.0',
'Keras==2.2.4',
'keras-contrib@git+https://github.com/keras-team/keras-contrib.git#egg=keras-contrib',
'en-core-web-sm@https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.3.0/en_core_web_sm-2.3.0.tar.gz#egg=en-core-web-sm'
]
...
setup(
name=NAME,
version=VERSION,
description=DESCRIPTION,
install_requires=REQUIRES_INSTALL,
...
)
在建造轮子或鸡蛋时,一切都很好:python setup.py bdist_wheel。
但是当尝试使用pip install -U dist/mypack-....whl 安装软件包(whl 或 egg)时。
我明白了:
ERROR: Could not find a version that satisfies the requirement keras-contrib (from mypack==0.3.5) (from versions: none)
ERROR: No matching distribution found for keras-contrib (from mypack==0.3.5)
...
ERROR: Could not find a version that satisfies the requirement en-core-web-sm (from mypack==0.3.5) (from versions: none)
ERROR: No matching distribution found for en-core-web-sm (from mypack==0.3.5)
我已经尝试通过setup.cfg 进行相同的操作,但仍然没有运气。
作为参考 - 当首先从 requirments.txt 安装它们然后安装轮子时,所有这些依赖项都可以工作。
spacy==2.3.2
tensorflow==1.14.0
Keras==2.2.4
keras-contrib@git+https://github.com/keras-team/keras-contrib.git#egg=keras-contrib
en-core-web-sm@https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.3.0/en_core_web_sm-2.3.0.tar.gz#egg=en-core-web-sm
pip install -r requirements.txt
pip install -U dist/mypack-....whl
但这不是干净的方式,因为轮子应该是独立的。
感谢您的任何提示!
环境
- Python:3.7.0
- 点数:20.2.4
- 设置工具:50.3.2
【问题讨论】:
标签: python dependencies setuptools setup.py