![](/img/trans.png)
[英]How to exclude a single file from package with setuptools and setup.py
[英]how to exclude particular dependency package version from setup file in python
我有一个小型 package,它在torch v1.8.0
上不起作用,但在新的v1.8.1
版本和其他旧版本v1.7.1
上运行良好,所以想排除v1.8.0
版本。
我可以设置
install_requires=[
"torch>=1.8.1",
...
但是手电筒 package 尺寸很大,并且还希望mypackage
在旧版本的手电筒上工作。
我试过了
install_requires=[
"torch>=1.8.1,!=1.8.0,<=1.7.1",
...
但是在使用pip install mypackage
会出现以下错误:
ERROR: Could not find a version that satisfies the requirement torch!=1.8.0,<=1.7.1,>=1.8.1 (from mypackage) (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2, 0.4.1, 0.4.1.post2, 1.0.0, 1.0.1, 1.0.1.post2, 1.1.0, 1.2.0, 1.3.0, 1.3.1, 1.4.0, 1.5.0, 1.5.1, 1.6.0, 1.7.0, 1.7.1, 1.8.0, 1.8.1)
ERROR: No matching distribution found for torch!=1.8.0,<=1.7.1,>=1.8.1 (from mypackage)
怎么能排除v1.8.0
版本? 谢谢你。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.