在我的项目中,我需要同时支持Linux和Windows,因此我遵循了these准则并将这些行添加到了我的pyproject.toml
文件中:
[tool.poetry.dependencies]
torch = [
{url="https://download.pytorch.org/whl/cu101/torch-1.4.0-cp36-cp36m-win_amd64.whl", markers="sys_platform=='win32'"},
{url="https://download.pytorch.org/whl/cu101/torch-1.4.0-cp36-cp36m-linux_x86_64.whl", markers="sys_platform!='win32'"}
]
(此外,我尝试了os_name=='nt'
)
但是当我尝试运行poetry update
时,出现以下错误:
[RuntimeError]
The Poetry configuration is invalid:
- [dependencies.torch] [{'url': 'https://download.pytorch.org/whl/cu101/torch-1.4.0-cp36-cp36m-win_amd64.whl', 'markers': "sys_platform=='win32'"}, {'url': 'https://download.pytorch.org/whl/cu101/torch-1.4.0-cp36-cp36m-linux_x86_64.whl', 'markers': "sys_platform!='win32'"}] is not valid under any of the given schemas
使用Poetry在不同平台上安装同一软件包的不同版本的正确方法是什么?