feat req: Improve Isaac Lab Support Through Solving PyPi <-> Conda Deps and Parsing UV Index Tags
Problem description
Hi Pixi devs,
I'm looking forward to using Pixi this New Year! As always, I've been enjoying using Pixi on my project. I wanted to share two small issues I ran into while using Pixi with Isaac Lab. Luckily, due to Pixi's flexibility, I could still get around my issues so I'm currently unblocked: https://github.com/isaac-sim/IsaacLab/issues/3884#issuecomment-3704212803 . I'd love to hear your thoughts and to get some help.
I believe the two problems I ran into are related partially to to the ongoing UV/PyPI integration, but I may have missed related issues on this repo. I have some feature ideas that I'd be curious to hear your thoughts on, that maybe have been already considered. I'd be happy to provide any extra info!
The two issues I experienced were:
1.) Installed Conda Package Versions Being Pinned Relative to PyPi Package Version Requirements
I added isaacsim = { version = "==5.1.0", index = "https://pypi.nvidia.com", extras = ["all", "extscache"] } as a dependency in my pixi.toml in the pypi-dependencies section. I found that many Isaacsim subpackages depend on some package A at version a, which had already been installed as a dependency at version b for some conda package. As Pixi seemingly pins conda package versions when solving the PyPi deps, the isaacsim subpackages wouldn't install as a != b. I ended up vibe-coding a silly script that just iteratively collected the transitive dependency version that PyPi wanted, and added it as a Conda or PyPi package in the manifest pinned at that exact version. Although this works for me for now, I am hesitant about how well upgrading will go for me.
I'd really love to have an option to unpin the conda dependencies when solving the pypi dependencies.
I'd also love to be able to do this selectively per package, but even just globally overall it would a nice option to have. I think even a one stage solve where one could choose whether to have the conda versions be more flexible would significantly improve the PyPI support for complex packages.
Here is an example (where scipy wasn't initially specified in my pixi.toml, but some other conda package depended on it):
garylvov@minerva:~/projects/gigastrap$ pixi update
WARN The package `requests==2.32.5` does not have an extra named `socks`
WARN The package `requests==2.32.5` does not have an extra named `socks`
WARN The package `requests==2.32.5` does not have an extra named `socks`
WARN The package `requests==2.32.5` does not have an extra named `socks`
⠂ isaaclab-gpu:linux-6400:00:00] resolving isaacsim==5.1.0.0
⠒ ros2-gpu:linux-64 [00:00:00] resolving pytorch3d==0.7.8+5043d15pt2.7.0cu128
⠂ gsi:linux-64 [00:00:00] resolving pytorch3d==0.7.8+5043d15pt2.7.0cu128
⠒ gsi-ros2:linux-64 [00:00:00] resolving pytorch3d==0.7.8+5043d15pt2.7.0cu128
Error: × failed to solve the pypi requirements of environment 'gsn' for platform 'linux-64'
├─▶ failed to resolve pypi dependencies
╰─▶ Because isaacsim-core==5.1.0.0 depends on scipy==1.15.3 and scipy==1.16.3, we can conclude that isaacsim-core==5.1.0.0 cannot be used.
And because isaacsim[all]==5.1.0.0 depends on isaacsim-core==5.1.0.0 and you require isaacsim[all]==5.1.0, we can conclude that your requirements are unsatisfiable.
help: The following PyPI packages have been pinned by the conda solve, and this version may be causing a conflict:
scipy==1.16.3
I also found the pypi-options.dependency-overrides option to be incredibly helpful, which helped me get around some metadeta issues in the isaac sim release wheels. However, I did have to do this for many packages in a row as part of my silly script linked above, Maybe it could be helpful to add to be a solver option like --lazy-deps or --sloppy-deps to be able to relax these constraints for a package at once for potential mismatches instead of doing them one by one, but I can understand how that isn't maintainable (and an argument can be made that the upsream package metadata should be instead updated to be correct). Here is an example where it helped me, I'm also not sure if this is intended behavior when reading the packages either:
garylvov@minerva:~/projects/gigastrap$ pixi install
⠲ isaaclab-ros2-gpu:linux- [00:00:00] resolving pytorch3d==0.7.8+5043d15pt2.7.0cu128
⠲ gsn:linux-64 [00:00:00]
Error: × failed to solve the pypi requirements of environment 'isaaclab-gpu' for platform 'linux-64'
├─▶ failed to resolve pypi dependencies
╰─▶ Because isaacsim-kernel==5.1.0.0 depends on pillow==12.0.0 and isaacsim==5.1.0.0 depends on isaacsim-kernel==5.1.0.0, we can conclude that isaacsim==5.1.0.0 depends on
pillow==12.0.0. (1)
Because isaacsim-kernel==5.1.0.0 depends on pillow==11.3.0 and isaacsim==5.1.0.0 depends on isaacsim-kernel==5.1.0.0, we can conclude that isaacsim==5.1.0.0 depends on
pillow==11.3.0.
And because we know from (1) that isaacsim==5.1.0.0 depends on pillow==12.0.0, we can conclude that isaacsim[all]==5.1.0.0 cannot be used.
And because you require isaacsim[all]==5.1.0, we can conclude that your requirements are unsatisfiable.
help: The following PyPI packages have been pinned by the conda solve, and this version may be causing a conflict:
pillow==12.0.0
2.) tool.uv.sources causes parse failure for git dependencies for mujoco_warp and newton
I found that two packages use tool.uv.sources to specify some dependencies, which weren't parsed correctly
It would be great to be able to parse these not sure if I missed an existing issue
garylvov@minerva:~/projects/gigastrap$ pixi add --pypi --git https://github.com/google-deepmind/mujoco_warp.git --rev e9a67538f2c14486121635074c5a5fd6ca55fa83 mujoco-warp
Error: × failed to solve the pypi requirements of environment 'ros2-gpu' for platform 'linux-
│ 64'
├─▶ Failed to convert Trailing `(index: https://py.mujoco.org/)` is not allowed
│ mujoco>=3.3.7 (index: https://py.mujoco.org/)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
╰─▶ Trailing `(index: https://py.mujoco.org/)` is not allowed
mujoco>=3.3.7 (index: https://py.mujoco.org/)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Thank you!
Hi @garylvov, glad to hear you're benefitting from Pixi!
The issue descibed in request 1 is one of the most problematic parts of the combination of conda and pypi. I like the idea of trying a lazy option. @tdejager or @nichmor could you guys give some input on potential prototype ideas?
For item 2, @tdejager using thetool.uv.sources from a package that we install from git. Would we be able to let UV handle even more of that?
hi @garylvov ! Thanks for raising the issue(s)!
- Do you mean by
lazy-depsto relax all sub-dependencies of a specific package? ( as we would use dependency-overrides for all of them, and puttinganyversion there? )
Hi thank you @ruben-arts @nichmor for your fast support!
By lazy-deps, I mean ignore only conflicting versions across sub-packages. Like if metapackage x depends on y and z, and y depends on w==2.0 and z depends on w==1.0, then only w's conflict should be ignored (as they may have other deps that are agreeable that I don't want to explicitly ignore). In my silly script, I would default to the latest version of w for the pypi-overrides.
I'd still like to have the functionality to solve pinned conda packages relative to PyPi by unpinning the conda deps, as I think there are deps that don't conflict within the PyPi metapackages, but conflict with the pinned conda deps. Here is an excerpt from my manifest. I think the lazy-deps could clean up the messiness of my pypi-dependencies section, while an upgraded dep solver that unpins conda packages could get rid of the exact pins in the conda dep section.
[feature.isaaclab.dependencies]
# Other than CMAKe, all of these pinned deps were already installed, but isaac wanted a specific version that was implicitly pinned by conda
cmake = ">3.6"
# Pin versions required by isaacsim-kernel to override conda's defaults
psutil = "==5.9.8"
propcache = "==0.2.1"
aiohappyeyeballs = "==2.4.4"
pytz = "==2024.1"
frozenlist = "==1.5.0"
charset-normalizer = "==3.3.2"
watchdog = "==4.0.0"
aiosignal = "==1.3.2"
coverage = "==7.4.4"
typing-extensions = "==4.12.2"
idna = "==3.10"
yarl= "==1.18.3"
multidict = "==6.1.0"
attrs = "==25.1.0"
click = "==8.1.7"
aiohttp = "==3.11.11"
sympy = "==1.13.3"
networkx = "==3.3"
# mujoco moved to [feature.gpu.pypi-dependencies] to avoid libabseil conflict
fsspec = "==2024.6.1"
filelock = "==3.13.1"
cryptography = "==44.0.0"
pyyaml = "==6.0.2"
tornado = "==6.5.1"
packaging = "==23.0"
kiwisolver = "==1.4.4"
cycler = "==0.11.0"
pyparsing = "==3.0.9"
fonttools = "==4.55.3"
contourpy = "==1.3.1"
matplotlib = "==3.10.3"
markupsafe = "==2.1.3"
nest-asyncio = "==1.5.6"
# Conda pywin32 stub satisfies isaacsim's mistaken pywin32 requirement on Linux
pywin32 = ">=306"
ipywidgets = "==8.1.5"
[feature.isaaclab.system-requirements]
libc = {family = "glibc", version = "2.35"}
[feature.isaaclab.pypi-dependencies]
# a dep that likes to raise trouble ;)
isaacsim = { version = "==5.1.0", index = "https://pypi.nvidia.com", extras = ["all", "extscache"] }
scipy = "==1.16.3" # exact requested version not found in conda, added here for now
[feature.isaaclab.pypi-options.dependency-overrides]
# I think this section could be cleaned up with the ``lazy-dep`` option
numpy = "==1.26.4"
torch = "==2.7.1"
pillow = "==12.0.0"
scipy = "==1.16.3"
pywin32 = "*" # needed to trick isaac
triton = "==3.3.0"
requests = "==2.32.5"
isaacsim-kernel = "==5.1.0.0"
starlette = "==0.49.1"
For item 2) this is something we fixed before. I think even by @Hofer-Julian but this may have regressed.
For unpinning the conda deps I'm not sure I follow. The conda solve is executed before the PyPI solve. So the conda versions have been determined. Then when doing the PyPI solve we tell uv choose that version for the conda chosen package. Unpinning this would mean:
- The solve could choose a version that conflicts with non PyPI dependencies in the conda environment. (Like a different major version)
- It could choose a version not available on the conda channels.
- It could choose a version that maps to a different conda name than te previous selected version.
To do this correctly you would need to ieteratively keep solving conda and PyPI deps to get to a solution, and adding constraints while doing it. Which is basically a SAT solve :) Or do you mean pinning to a semver range instead of a single version?
Hi thanks for your inight @tdejager !
Sorry for any confusion; I think you're right that this would require doing a SAT solve for both Conda and PyPi simultaneously to solve this properly. By "unpinning" I really meant doing the correct full SAT solve. My silly script does something analogous to the SAT solve through the iterative approach you mentioned (and is able to partially detect case 2 that you mentioned).
The second issue with the UV index tags was resolved for me by upgrading from 0.53.0 to 0.62.2 !
@tdejager I was curious whether it would be possible (although not correct) to change the conda-python-package==x.y.z to conda-python-package with potentionally the requirement that the user gives or none at all.
Lot's of cases are erroring out on the conda version not working with the pypi version in terms of requirements but practically this might not be the case. e.g. some projects say pytorch==2.9.0 while conda-forge only has pytorch==2.9.1. This fails the whole solve but using a 'lazy' (or unbounded) solve it might just get it right. This is far from perfect, but it might help unblock some annoying situations if it could work.
So what we do is basically override the provider, so when uv requests pytorch we've overriden it by saying. Oh we pinned 2.9.1 so that is the only version available. We do not change any requirements, these are all handled by uv itself so if a project has a requirement like >=2.9 this is fine while >=2.9.2 would fail. We could provide the one version we pinned for the whole semver range, so map 2.9.1 to all 2.9.x versions, but this is essentially misleading and could break things.
Changing the requirement of a PyPI dependency dependent on PyTorch is exactly what the dependency-overrides does and then it is also clarified in the manifest. The limitiation is that you are not able to do this per package, uv does not have that interface. But I do feel dependency-overrides is the clearest approach here. We could potentially make a feature to add these automatically somehow?
I also just ran into some interesting behavior with the same troublemaker Isaac sim package. I'm sorry for including several quirks in one, I can open a new issue if that helps! Let's call this subissue 3 for now😅 Thank you all for your help and patience, I really appreciate it!!
I've made sure to be on 0.62.2 on all machines this time.
3.)
On Ubuntu 24, the following libc system requirement works great for me to ensure 2.35, and I'm able to activate my environment without any exra flags
[feature.isaaclab.system-requirements]
libc = "==2.35"
If I don't include the libc sysem requirement on Ubuntu, I get the following error, so I'm confident that the libc specification is helping resolve my issue completely on Ubuntu 24.
garylvov@minerva:~/projects/gigastrap$ pixi s -e gsn
Error: × failed to solve the pypi requirements of environment 'isaaclab-gpu' for platform
│ 'linux-64'
├─▶ failed to resolve pypi dependencies
╰─▶ Because isaacsim[all]==5.1.0.0 has no wheels with a matching platform tag (e.g.,
`manylinux_2_28_x86_64`) and you require isaacsim[all]==5.1.0, we can conclude
that your requirements are unsatisfiable.
hint: `isaacsim` was found on https://pypi.nvidia.com/, but not at the requested
version (isaacsim==5.1.0.0). A compatible version may be available on a subsequent
index (e.g., https://py.mujoco.org/). By default, uv will only consider versions
that are published on the first index that contains a given package, to avoid
dependency confusion attacks. If all indexes are equally trusted, use `--index-
strategy unsafe-best-match` to consider all versions from all indexes, regardless
of the order in which they were defined.
hint: Wheels are available for `isaacsim` (v5.1.0.0) on the following platforms:
`manylinux_2_35_aarch64`, `manylinux_2_35_x86_64`, `win_amd64`
# Then I add Libc to the manifest and everything works great!
garylvov@minerva:~/projects/gigastrap$ pixi s -e gsn
(gigastrap:gsn) garylvov@minerva:~/projects/gigastrap$
However, on Red Hat Enterprise Linux 9.2 (Plow), I get the following issue with the same manifest, that includes the libc = "2.35" system requirement.
[glvov@gpu2601 gigastrap]$ pixi s -e gsn
Error: × Cannot install environment 'gsn'
╰─▶ Wheel: isaacsim-5.1.0.0-cp311-none-manylinux_2_35_x86_64.whl doesn't match this systems virtual
capabilities for tags: cp311-cp311-manylinux_2_34_x86_64
cp311-cp311-manylinux_2_33_x86_64
cp311-cp311-manylinux_2_32_x86_64
cp311-cp311-manylinux_2_31_x86_64
cp311-cp311-manylinux_2_30_x86_64
cp311-cp311-manylinux_2_29_x86_64
cp311-cp311-manylinux_2_28_x86_64
cp311-cp311-manylinux_2_27_x86_64
cp311-cp311-manylinux_2_26_x86_64
cp311-cp311-manylinux_2_25_x86_64
# and so on for many manylinux options
Luckily, if I also specify CONDA_OVERRIDE_GLIBC=2.35, when activating my environment on RHEL 9.2, it works great.
[glvov@gpu2601 gigastrap]$ CONDA_OVERRIDE_GLIBC=2.35 pixi s -e gsn
(gigastrap:gsn) [glvov@gpu2601 gigastrap]$
The conda override option works sufficiently for me, and so I'm not blocked by this quirk at all, but I figured it's an interesting behavior that you all might want to know about!
Hey @garylvov thanks for looking into this!
Can you check what virtual packages are printed with pixi info on Red Hat Enterprise Linux? Because that would show us if our glibc detection is wrong.
It should print something like:
Virtual packages: __unix=0=0
: __linux=6.6.87.2=0
: __glibc=2.35=0
: __cuda=13.1=0
: __archspec=1=x86_64_v4
Hi! My school's cluster was just upgraded to RHEL 9.6, and exhibits the same behavior as I saw on RHEL 9.2. I'm realizing the detection is not wrong, I think I mistakenly interpreted the system-requirements to be more of a systems override option. It makes more sense to me now why the CONDA_OVERRIDE_GLIBC=2.35 is needed
[glvov@gpu2605 gigastrap]$ cat /etc/redhat-release
Red Hat Enterprise Linux release 9.6 (Plow)
[glvov@gpu2605 ~]$ rpm -q glibc
glibc-2.34-231.0.1.el9_7.2.x86_64
[glvov@gpu2605 glvov]$ pixi info
System
------------
Pixi version: 0.62.2
TLS backend: rustls
Platform: linux-64
Virtual packages: __unix=0=0
: __linux=5.14.0=0
: __glibc=2.34=0
: __cuda=12.9=0
: __archspec=1=zen2
Cache dir: /users/glvov/.cache/rattler/cache
Auth storage: /users/glvov/.rattler/credentials.json
Config locations: No config files found
Global
------------
Bin dir: /users/glvov/.pixi/bin
Environment dir: /users/glvov/.pixi/envs
Manifest dir: /users/glvov/.pixi/manifests/pixi-global.toml
[glvov@gpu2605 glvov]$ cd gigastrap/
[glvov@gpu2605 gigastrap]$ pixi s -e gsn
Error: × Cannot install environment 'gsn'
╰─▶ Wheel: isaacsim-5.1.0.0-cp311-none-manylinux_2_35_x86_64.whl doesn't match this systems virtual capabilities for tags: cp311-cp311-
manylinux_2_34_x86_64
cp311-cp311-manylinux_2_33_x86_64
cp311-cp311-manylinux_2_32_x86_64
cp311-cp311-manylinux_2_31_x86_64
cp311-cp311-manylinux_2_30_x86_64
cp311-cp311-manylinux_2_29_x86_64
cp311-cp311-manylinux_2_28_x86_64
cp311-cp311-manylinux_2_27_x86_64
cp311-cp311-manylinux_2_26_x86_64
cp311-cp311-manylinux_2_25_x86_64
cp311-cp311-manylinux_2_24_x86_64
# and so on for many versions....
[glvov@gpu2605 gigastrap]$ CONDA_OVERRIDE_GLIBC=2.35 pixi s -e gsn
(gigastrap:gsn) [glvov@gpu2605 gigastrap]$ # all of my scripts work as expected after this
EDIT: I tried adding libc = "==2.35" to my [feature.isaaclab.pypi-options.dependency-overrides] section with the same behavior
@wolfv chiming it with my 2 cents - could it be the problem that glibc declared in manifest ( [feature.isaaclab.system-requirements]) is used for solving part, but when we try to get platform tags we are using virtualpackages override ( which then try to read CONDA_OVERRIDE_GLIBC or the one that its present in the system)?
that's why we have a mismatch between declaring 2.35 in the manifest and 2.34 present in the system?
xref https://github.com/conda-forge/staged-recipes/pull/32698
Its getting a bit big this one, can we condense it down to what we would actually need? @garylvov :)
I guess the MVP for this would be a lazy-deps option, where we'd allow an item within a manifest while not being so strict about what it depends on.
Sorry to surf your brain 😅: but to do what and why again?
Some pypi-based dependencies, such as isaacsim, have many dependencies, that are pinned to specific versions. These very specific versions make it hard to have pypi-based isaacsim be compatible with other dependencies such as conda-based ros-jazzy-desktop-full(as ROS 2 jazzy itself has many dependencies).
Since conda-based packages are installed first, and pinned during the pypi/uv solve portion, it errors out on isaacsim, even though there exists some set of package versions that would work with both pypi-based isaacsim and conda-based ros-jazzy-desktop-full. In this case, one has to manually find the set of compatible package versions, or use an iterative script such as: https://gist.github.com/garylvov/ae19041199bff81795d7e85f3be1ea56
What I've found, is that although isaacsim's deps are pinned to very specific versions, it actually works fine with other versions (like, for example, matching major versions, but mismatching minor versions). So, to get the isaacsim to work, I have to use a mix of pinning packages into conda that it error'd out on, or using the pypi-dependency-override option to get it to ignore a dependency mismatch. ( I use my auto gist linked above for this).
When adding the pypi-based isaacsim to my manifest, I'd love to have a lazy-deps option. What this option would do, is to ignore a conflict in a dependency (say, if my conda env has numpy==2.35 pinned during the pypi solve, and isaacsim depends on numpy==2.30 , then auto ignore this mismatch. Or similar for glibc). However, if I'm missing a dependency altogther, still install it. Maybe if there is a significant mismatch, between conda and pypi, we can specify all mismatches at once in a format that can be pasted into the pixi.toml to fix the conda versions in a single pass.
Sorry if this wasn't clear I'd be happy to provide any clarification 😅
Hey @garylvov, I get the problem now. However, I think the problem with lazy-deps, is two-fold:
- We'd need to change it in the uv solve(r), and I don't see them accepting a PR that basically turns of the checking of dependency constraints for specific packages, an override option as you know already exists.
- You lose all guarantees if this works at all and especially keeps working in a future solve, like a regeneration of the lock file.
Might be interesting to paste in a pixi.toml, so that we can see what you end up with. Just tagging @ruben-arts here, because we are really interested in getting isaacsim to work nicely with pixi. Maybe an extension that finds the correct overrides or an actual iscaacsim conda package might be something we could do.
Hi @garylvov,
One question that comes to mind after having talked with some NVIDIA Isaac Sim people is that you might just be able to make a completely separate environment for the Isaac Sim and one for the ROS side of things. Did you experiment with that?