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

Can't install python=3.12 and torchvision=0.19.1 with pixi, but works with mamba #2006

Closed
2 tasks done
asmith26 opened this issue Sep 8, 2024 · 3 comments
Closed
2 tasks done
Labels
🐞 bug Something isn't working

Comments

@asmith26
Copy link

asmith26 commented Sep 8, 2024

Checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pixi, using pixi --version.

Reproducible example

Unfortunately this doesn't work:

[project]
authors = [{name = "name", email = "email@email.com"}]
dependencies = []
description = "Add a short description here"
name = "test_env"
requires-python = ">= 3.12"
version = "0.1.0"

[tool.pixi.project]
channels = ["pytorch", "conda-forge"]
platforms = ["linux-64"]

[tool.pixi.dependencies]
python = ">=3.12"
torchvision = ">=0.19.1"

running pixi install yields:

  × failed to solve the conda requirements of 'default' 'linux-64'
  ╰─▶ Cannot solve the request because of: torchvision >=0.19.1 cannot be installed
      because there are no viable options:
      ├─ torchvision 0.19.1 | 0.19.1 | 0.19.1 | 0.19.1 | 0.19.1 would require
      │  └─ pytorch-cuda 12.1.*, which cannot be installed because there are no
      viable options:
      │     └─ pytorch-cuda 12.1 would require
      │        └─ libcublas >=12.1.0.26,<12.1.3.1, for which no candidates were
      found.
      └─ torchvision 0.19.1 | 0.19.1 | 0.19.1 | 0.19.1 | 0.19.1 would require
         └─ pytorch-cuda 11.8.*, which cannot be installed because there are no
      viable options:
            └─ pytorch-cuda 11.8 | 11.8 | 11.8 would require
               └─ cuda 11.8.*, for which no candidates were found.
      python >=3.12 cannot be installed because there are no viable options:
      └─ python 3.13.0rc1 | 3.13.0rc1 | 3.13.0rc1 | 3.13.0rc1 | 3.13.0rc1 |
      3.13.0rc1 would require
         └─ _python_rc *, for which no candidates were found.
      The following packages are incompatible
      ├─ torchvision >=0.19.1 can be installed with any of the following options:
      │  ├─ torchvision 0.19.1 | 0.19.1 would require
      │  │  └─ pillow >=5.3.0,!=8.3.*, which can be installed with any of the
       following options:
      │  │     ├─ pillow 9.2.0 | 9.2.0 | 9.4.0 would require
      │  │     │  └─ python_abi 3.11.* *_cp311, which can be installed with any of
      the following options:
      │  │     │     └─ python_abi 3.11
      │  │     ├─ pillow 8.4.0 | 9.0.0 | 9.0.1 | 9.0.1 | 9.0.1 | 9.1.0 | 9.1.0 |
      9.1.0 | 9.1.1 | 9.1.1 | 9.2.0 | 9.2.0 | 9.2.0 | 9.2.0 | 9.2.0 | 9.4.0 would
      require
      │  │     │  └─ python_abi 3.10.* *_cp310, which can be installed with any of
      the following options:
      │  │     │     └─ python_abi 3.10
      │  │     ├─ pillow 7.2.0 | 8.0.0 | 8.0.1 | 8.0.1 | 8.1.0 | 8.1.0 | 8.1.0 |
      8.1.1 | 8.1.2 | 8.1.2 | 8.2.0 | 8.4.0 | 9.0.0 | 9.0.1 | 9.0.1 | 9.0.1 | 9.1.0
      | 9.1.0 | 9.1.0 | 9.1.1 | 9.1.1 | 9.2.0 | 9.2.0 | 9.2.0 | 9.2.0 | 9.2.0 |
      9.4.0 would require
      │  │     │  └─ python_abi 3.9.* *_cp39, which can be installed with any of the
      following options:
      │  │     │     └─ python_abi 3.9 | 3.9
      │  │     ├─ pillow 6.2.2 | 7.0.0 | 7.1.1 | 7.1.2 | 7.2.0 | 7.2.0 | 7.2.0 |
      8.0.0 | 8.0.1 | 8.0.1 | 8.1.0 | 8.1.0 | 8.1.0 | 8.1.1 | 8.1.2 | 8.1.2 | 8.2.0
      | 8.4.0 | 9.0.0 | 9.0.1 | 9.0.1 | 9.0.1 | 9.1.0 | 9.1.0 | 9.1.0 | 9.1.1 |
      9.1.1 | 9.2.0 | 9.2.0 | 9.2.0 | 9.2.0 | 9.2.0 | 9.4.0 would require
      │  │     │  └─ python_abi 3.8.* *_cp38, which can be installed with any of the
      following options:
      │  │     │     └─ python_abi 3.8 | 3.8 | 3.8
      │  │     ├─ pillow 6.2.2 | 7.0.0 | 7.1.1 | 7.1.2 | 7.2.0 | 7.2.0 | 7.2.0 |
      8.0.0 | 8.0.1 | 8.0.1 | 8.1.0 | 8.1.0 | 8.1.0 | 8.1.1 | 8.1.2 | 8.1.2 | 8.2.0
      | 8.4.0 | 9.0.0 | 9.0.1 | 9.0.1 | 9.0.1 | 9.1.0 | 9.1.0 | 9.1.0 | 9.1.1 |
      9.1.1 | 9.2.0 | 9.2.0 | 9.2.0 would require
      │  │     │  └─ python_abi 3.7.* *_cp37m, which can be installed with any of
      the following options:
      │  │     │     └─ python_abi 3.7 | 3.7 | 3.7
      │  │     ├─ pillow 6.2.2 | 7.0.0 | 7.1.1 | 7.1.2 | 7.2.0 | 7.2.0 | 7.2.0 |
      8.0.0 | 8.0.1 | 8.0.1 | 8.1.0 | 8.1.0 | 8.1.0 | 8.1.1 | 8.1.2 | 8.1.2 | 8.2.0
      would require
      │  │     │  └─ python_abi 3.6.* *_cp36m, which can be installed with any of
      the following options:
      │  │     │     └─ python_abi 3.6 | 3.6 | 3.6
      │  │     └─ pillow 6.2.1 | 6.2.1 | 7.0.0 would require
      │  │        └─ python >=3.8,<3.9.0a0, which can be installed with any of the
      following options:
      │  │           └─ python 3.8.14 | 3.8.14 | 3.8.15 | 3.8.15 | 3.8.15 | 3.8.16 |
      3.8.16 | 3.8.17 | 3.8.18 | 3.8.18 | 3.8.19
      │  ├─ torchvision 0.19.1 | 0.19.1 would require
      │  │  └─ python >=3.10,<3.11.0a0, which can be installed with any of the
      following options:
      │  │     └─ python 3.10.9 | 3.10.11
      │  ├─ torchvision 0.19.1 | 0.19.1 would require
      │  │  └─ python >=3.9,<3.10.0a0, which can be installed with any of the
      following options:
      │  │     └─ python 3.9.14 | 3.9.14 | 3.9.15 | 3.9.16 | 3.9.16 | 3.9.17 |
      3.9.17 | 3.9.18 | 3.9.18 | 3.9.18 | 3.9.18 | 3.9.19
      │  └─ torchvision 0.19.1 | 0.19.1 would require
      │     └─ python >=3.8,<3.9.0a0, which can be installed with any of the
      following options:
      └─ python >=3.12 cannot be installed because there are no viable options:
         ├─ python 3.12.5, which conflicts with the versions reported above.
         └─ python 3.12.0 | 3.12.1 | 3.12.1 | 3.12.2 | 3.12.3 | 3.12.4, which
      conflicts with the versions reported above.

Issue description

The compatible package does indeed appear to exist: https://anaconda.org/pytorch/torchvision/files?version=0.19.1

Expected behavior

This works (e.g. I can successfully import torchvision)

mamba create -n test_env python=3.12 torchvision=0.19.1 -c pytorch -c conda-forge
@asmith26 asmith26 added the 🐞 bug Something isn't working label Sep 8, 2024
@asmith26 asmith26 changed the title Can't install python=3.12 and torchvision with pixi, but works with mamba Can't install python=3.12 and torchvision=0.19.1 with pixi, but works with mamba Sep 8, 2024
@tdejager
Copy link
Contributor

tdejager commented Sep 9, 2024

I can't figure out why it cannot install just yet (@ruben-arts) has looked more into torch issues, he might have some insight. But at least this is working for me:

[project]
dependencies = []
description = "Add a short description here"
name = "test_env"
version = "0.1.0"
requires-python = ">= 3.12"

[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["linux-64"]

[tool.pixi.dependencies]
torchvision = ">=0.19.0"

This does depend on a patch version less than the one that you proposed but is making use of the conda-forge channel exclusively.

@ruben-arts
Copy link
Contributor

There are two ways to fix this:

  • Verbose but correct way, set the channels per dependency that is not coming from the first channel:
#...
[tool.pixi.project]
# Switch channels to make conda-forge the highest priority
channels = ["conda-forge","pytorch"]
platforms = ["linux-64"]

[tool.pixi.dependencies]
python = ">=3.12"
# Define all packages you want to fetch from 'pytorch' with a specific channel.
# You could leave the once that only exist on 'pytorch' channel out but this is the safest way. 
pytorch = {channel = "pytorch", version = "*"}
pytorch-cuda = {channel = "pytorch", version = "*"}
pytorch-mutex = {channel = "pytorch", version = "*"}
torchtriton = {channel = "pytorch", version = "*"}
torchvision = {channel = "pytorch", version = ">=0.19.0"}
  • Fast but possibly dangerous way, disable channel-priority.
#...
[tool.pixi.project]
channels = ["conda-forge","pytorch"]
# Let pixi use any mix of packages from all channels and just give any solution. 
channel-priority = "disabled"
platforms = ["linux-64"]

[tool.pixi.dependencies]
python = ">=3.12"
torchvision = ">=0.19.0"

ps. don't forget to set the cuda system-requirements:

[tool.pixi.system-requirements]
cuda = "12.1"

@asmith26
Copy link
Author

Thanks very much for your help @tdejager @ruben-arts

This works for me:

[project]
authors = [{name = "name", email = "email@email.com"}]
dependencies = []
description = "Add a short description here"
name = "test_env"
requires-python = ">= 3.12"
version = "0.1.0"

[tool.pixi.project]
channels = ["conda-forge","pytorch"]
platforms = ["linux-64"]

[tool.pixi.dependencies]
python = ">=3.12"
pytorch = {channel = "pytorch", version = "*"}
torchvision = {channel = "pytorch", version = ">=0.19.1"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants