Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency walk failed #186

Closed
smvsmv opened this issue Mar 8, 2023 · 4 comments
Closed

Dependency walk failed #186

smvsmv opened this issue Mar 8, 2023 · 4 comments

Comments

@smvsmv
Copy link

smvsmv commented Mar 8, 2023

poetry export to requirements.txt fails with Dependency walk failed at torch (>=1.6.0) error

Any fix available? if not any workaround available?

Poetry (version 1.2.2)
System Version: macOS 13.2 (22D49)
Kernel Version: Darwin 22.3.0

pyproject.toml

[tool.poetry.dependencies]
python = "^3.9.9"
torch = [
    {markers = "platform_machine == \"arm64\"", url = "https://download.pytorch.org/whl/cpu/torch-1.13.1-cp39-none-macosx_11_0_arm64.whl"},
    {markers= "platform_machine != \"arm64\"", url="https://download.pytorch.org/whl/torch-1.13.1-cp39-cp39-manylinux2014_aarch64.whl"}]
sentence-transformers = "2.2.2"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

the poetry.lock has 2 versions for torch "1.13.1" and torch = ">=1.6.0"

[package.source]
type = "url"
url = "https://download.pytorch.org/whl/cpu/torch-1.13.1-cp39-none-macosx_11_0_arm64.whl"
[[package]]
name = "torch"
version = "1.13.1"
description = "Tensors and Dynamic neural networks in Python with strong GPU acceleration"
category = "main"
optional = false
python-versions = ">=3.7.0"

and torch = ">=1.6.0" coming from sentence-transformers

[[package]]
name = "sentence-transformers"
version = "2.2.2"
description = "Multilingual text embeddings"
category = "main"
optional = false
python-versions = ">=3.6.0"

[package.dependencies]
huggingface-hub = ">=0.4.0"
nltk = "*"
numpy = "*"
scikit-learn = "*"
scipy = "*"
sentencepiece = "*"
torch = ">=1.6.0"
torchvision = "*"
tqdm = "*"
transformers = ">=4.6.0,<5.0.0"
@okojoalg
Copy link

I encountered the same bug too.

part of pyproject.toml

[tool.poetry.dependencies]
python = ">=3.10,<3.11"
torch = [
    { platform = "darwin", url = "https://download.pytorch.org/whl/cpu/torch-2.1.0-cp310-none-macosx_11_0_arm64.whl" },
    { platform = "linux", url = "https://download.pytorch.org/whl/cu121/torch-2.1.0%2Bcu121-cp310-cp310-linux_x86_64.whl" }
]
torchvision = [
    { platform = "darwin", url = "https://download.pytorch.org/whl/cpu/torchvision-0.16.0-cp310-cp310-macosx_11_0_arm64.whl" },
    { platform = "linux", url = "https://download.pytorch.org/whl/cu121/torchvision-0.16.0%2Bcu121-cp310-cp310-linux_x86_64.whl" }
]
open-clip-torch = "^2.22.0"

then the exception is thrown if you run poetry export. But the exception is not thrown without lines containing darwin.

@happypgh
Copy link

happypgh commented Nov 8, 2023

I encountered the same bug too.

part of pyproject.toml

[tool.poetry.dependencies]
python = ">=3.10,<3.11"
torch = [
    { platform = "darwin", url = "https://download.pytorch.org/whl/cpu/torch-2.1.0-cp310-none-macosx_11_0_arm64.whl" },
    { platform = "linux", url = "https://download.pytorch.org/whl/cu121/torch-2.1.0%2Bcu121-cp310-cp310-linux_x86_64.whl" }
]
torchvision = [
    { platform = "darwin", url = "https://download.pytorch.org/whl/cpu/torchvision-0.16.0-cp310-cp310-macosx_11_0_arm64.whl" },
    { platform = "linux", url = "https://download.pytorch.org/whl/cu121/torchvision-0.16.0%2Bcu121-cp310-cp310-linux_x86_64.whl" }
]
open-clip-torch = "^2.22.0"

then the exception is thrown if you run poetry export. But the exception is not thrown without lines containing darwin.

I encountered the same bug too.

part of pyproject.toml

[tool.poetry.dependencies]
python = ">=3.10,<3.11"
torch = [
    { platform = "darwin", url = "https://download.pytorch.org/whl/cpu/torch-2.1.0-cp310-none-macosx_11_0_arm64.whl" },
    { platform = "linux", url = "https://download.pytorch.org/whl/cu121/torch-2.1.0%2Bcu121-cp310-cp310-linux_x86_64.whl" }
]
torchvision = [
    { platform = "darwin", url = "https://download.pytorch.org/whl/cpu/torchvision-0.16.0-cp310-cp310-macosx_11_0_arm64.whl" },
    { platform = "linux", url = "https://download.pytorch.org/whl/cu121/torchvision-0.16.0%2Bcu121-cp310-cp310-linux_x86_64.whl" }
]
open-clip-torch = "^2.22.0"

then the exception is thrown if you run poetry export. But the exception is not thrown without lines containing darwin.

I'm having the same issue with the same dependency structure for torch and torchvision like yours. Somebody please help...!

@gflatters
Copy link

I was running into this issue when building my docker image, setting the platform flag fixed it for me.

@radoering
Copy link
Member

Duplicate of #183

@radoering radoering marked this as a duplicate of #183 Mar 15, 2024
@radoering radoering closed this as not planned Won't fix, can't repro, duplicate, stale Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants