You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
🐍 Install pypi dependencies in pixi environment. #175
Conda/Mamba’s big flaw here is that it just uses pip, i.e. it first resolves conda deps and then lets pip loose on the pre-populated environment to alter it as it sees fit. That means that
dependency resolution can fail even though a valid solution might exist
pip might download and install packages a second time because it needs to down/upgrade them to resolve dependencies
Pixi could set itself apart by solving everything together and that way making these problems go away.
Reacted by goyalyashpal, Phil Elson, renan-abm, Sebastian Jung, Dan Blanchard and Elliot Waite
I assume you are aware of conda-lock? They have tackled essentially the same problem, doing a single solve taking everything into account using a mapping of how PyPI packages correspond to conda packages.
but wouldnt that require ability to link packages from coda-forge (i assuming this to be repo used by pixi) with those from pypi (repo used by pip) - both of which are in different formats. Is it possible?
The big problem, IMO, is that conda never introduced a namespace concept (at least, last time I checked) - and I don't mean channel namespacing, rather project namespacing. IMO, that would be a honking good idea, to allow us to clearly distinguish projects of the same name, but from different ecosystems (PyPI, CRAN, ...). The lack of this functionality will certainly make implementing the resolution harder, since you are going to have to guess if (missing) package "X" can be resolved by PyPI "X", or if it is a dependency that hasn't yet been published. If you get it working, it will lead to the uncomfortable situation where something works one day, and then somebody comes along and publishes a different project of the same name on a conda channel, and then pixi ceases to install from PyPI and starts getting the new thing (a form of dependency confusion).
I'm exited to see the conda ecosystem to start making use of the pure python wheels that are being published on PyPI though - if it can be done, it will result in 1000s of person-hours being saved as we will no longer need to publish pure-python conda packages. This optimisation is only possible since relatively recently, since it is increasingly common to see wheels being published, and it is easy to (heuristically) distinguish pure from compiled wheels.
Personally, I would love to see it be fully free of any middle-service - my view is that conda distributions are entirely unnecessary for pure Python projects, and I would love to see all conda-distribution based installers install the (mostly trivial) wheel format natively for those cases
I don't know if conda-forge would want to go in that direction, but I do know that Spack would like to. Repackaging pure Python projects is a lot of work/churn, so yes it can in principle make sense to avoid that. Of course there'll be pragmatic issues, like conda-forge having all channel metadata available in one file, and PyPI forcing you to do separate REST queries for each package - that may be a showstopper in the short/medium term.
Curious if there are any workarounds (it doesn't have to be principled or the right way) for this right now? Seems like if I activate my pixi shell and pip install stuff that doesn't work at all, ie. my python interpreter within the pixi shell only references conda installed packages. This would be a showstopper for me from using pixi right now.
I really like the direction pixi is going, so I'd really like to be an early adopter (and a work around would be appreciated). I see there's a branch that pupports to support that workflow, but looks like it's 300+ commits behind.
Which you could try out while waiting for us to work on this feature. We have started initial experiments with this issue.
Thanks, do you know how that works? I don't see what they're installing with pip, I've tried doing a pixi shell and then pip installing stuff, but that doesn't seem to work.
To me that looks like it's installing the current package as a pip dependency, but not dependencies that purely exist in pypi?
Curious if there are any workarounds (it doesn't have to be principled or the right way) for this right now? Seems like if I activate my pixi shell and pip install stuff that doesn't work at all, ie. my python interpreter within the pixi shell only references conda installed packages. This would be a showstopper for me from using pixi right now.
This is an issue caused by how we activate the environment when running pixi shell#297. It produces this weird behavior when you use for instance homebrew or a conda base environment. This will be fixed soon.
Thanks, so from doing some digging what I understand is that you're going to be implementing the conda lock strategy? Does that mean conda lock solves dependencies together (from pip and conda)?
unless one lockfile sees another (pixi lock sees poetry lock for example) I dont see any of these silutions as complete. Perhaps conda-lock is the only game in town for this (atleast for pip packages in the environment.yml) until pixi's combined resolution works. BTW i think once it works its gonna be a total gamechanger...
Reacted by William Jamir Silva, Daniel Wolff, Samantha Hughes, Bas Zalmstra, Konstantin Dobler and Niklas Rosenstein
Have started to use pixi for most of the new projects I'm starting and it's awesome! This feature is highly anticipated, installing from PyPi is the only real hurdle I've had to face so far. Do you have any vague idea of when we could expect this? Even just short vs. long term, weeks or months? :-)
This is currently my primary focus. We are building on our recently opensourced library https://github.com/prefix-dev/rip . Rip already contains a number of important required components.
The initial implementation will not be fully featured but we’ll continue building from there. I dont want to make promises but I hope to land something relatively short term.
Reacted by Constantine Karos, Olivier Lacroix, Konstantin Dobler and Roman Valls Guimera
Hey followers, we have an initial implementation in. This issue was a source of some good ideas! But we've continued since with implementing it, so i'll close it.
Summary of the current status (at time of writing) :
The solve, locking and installation of wheels is supported.
The build, solve, locking and installation of sdists is supported but will be improved overtime.
We're missing:
Locking build environments for sdists, for improved reproducibility
Use conda dependencies as build dependencies for sdists, to avoid the need of local system dependencies.
We're working hard on supporting more of these features while also building on the rest of pixi.
Most PyPI magic happens in rip, checkout its issues to follow the work there.
Reacted by Elliot Waite, ZhengYu, Xu and Kevin Lim
Activity
[-]Install pip dependencies after prefix installation[/-][+]Install pip dependencies in pixi environment.[/+]flying-sheep commentedon Aug 20, 2023
Conda/Mamba’s big flaw here is that it just uses pip, i.e. it first resolves conda deps and then lets pip loose on the pre-populated environment to alter it as it sees fit. That means that
Pixi could set itself apart by solving everything together and that way making these problems go away.
baszalmstra commentedon Aug 20, 2023
You are completely right. We have such a solution in the works as we speak!
zmbc commentedon Aug 21, 2023
I assume you are aware of conda-lock? They have tackled essentially the same problem, doing a single solve taking everything into account using a mapping of how PyPI packages correspond to conda packages.
wolfv commentedon Aug 22, 2023
Yes, we are also implementing the same YAML lock format as conda-lock. We want to implement the solver on our own though :) let's see how that goes.
manzt commentedon Aug 22, 2023
This would be awesome! Excited to see this feature.
goyalyashpal commentedon Aug 23, 2023
what would be the problem with mamba used libsolv?
wolfv commentedon Aug 23, 2023
@goyalyashpal we have also used libsolv (as in the C library) in rattler. There are some maintenance issues with libsolv (single-developer project) and the code is really hard to get into (it's proper "C" code if you know what I mean).
We've taken the time to port the central algorithm from libsolv (with lots of inspirations from libsolv codebase) to Rust in the rattler_libsolv_rs crate: https://github.com/mamba-org/rattler/tree/main/crates/rattler_libsolv_rs
Now we want to extend it to be generic enough to also consume PyPI version specs and solve for them.
You can read more about the solver here: https://prefix.dev/blog/the_new_rattler_resolver and in Adolfo's blog post: https://ochagavia.nl/blog/the-magic-of-dependency-resolution/
goyalyashpal commentedon Aug 23, 2023
but wouldnt that require ability to link packages from coda-forge (i assuming this to be repo used by pixi) with those from pypi (repo used by pip) - both of which are in different formats. Is it possible?
wolfv commentedon Aug 23, 2023
It's not going to be easy and there will probably be some rough edges, but I think we can come up with an interesting solution! :)
[-]Install pip dependencies in pixi environment.[/-][+]🐍 Install pip dependencies in pixi environment.[/+]pelson commentedon Aug 25, 2023
The big problem, IMO, is that conda never introduced a namespace concept (at least, last time I checked) - and I don't mean channel namespacing, rather project namespacing. IMO, that would be a honking good idea, to allow us to clearly distinguish projects of the same name, but from different ecosystems (PyPI, CRAN, ...). The lack of this functionality will certainly make implementing the resolution harder, since you are going to have to guess if (missing) package "X" can be resolved by PyPI "X", or if it is a dependency that hasn't yet been published. If you get it working, it will lead to the uncomfortable situation where something works one day, and then somebody comes along and publishes a different project of the same name on a conda channel, and then pixi ceases to install from PyPI and starts getting the new thing (a form of dependency confusion).
I'm exited to see the conda ecosystem to start making use of the pure python wheels that are being published on PyPI though - if it can be done, it will result in 1000s of person-hours being saved as we will no longer need to publish pure-python conda packages. This optimisation is only possible since relatively recently, since it is increasingly common to see wheels being published, and it is easy to (heuristically) distinguish pure from compiled wheels.
goyalyashpal commentedon Aug 25, 2023
have u ever thought about using micromamba?
3 remaining items
rgommers commentedon Aug 26, 2023
I don't know if conda-forge would want to go in that direction, but I do know that Spack would like to. Repackaging pure Python projects is a lot of work/churn, so yes it can in principle make sense to avoid that. Of course there'll be pragmatic issues, like conda-forge having all channel metadata available in one file, and PyPI forcing you to do separate REST queries for each package - that may be a showstopper in the short/medium term.
kszlim commentedon Aug 26, 2023
Curious if there are any workarounds (it doesn't have to be principled or the right way) for this right now? Seems like if I activate my pixi shell and pip install stuff that doesn't work at all, ie. my python interpreter within the pixi shell only references conda installed packages. This would be a showstopper for me from using pixi right now.
I really like the direction pixi is going, so I'd really like to be an early adopter (and a work around would be appreciated). I see there's a branch that pupports to support that workflow, but looks like it's 300+ commits behind.
tdejager commentedon Aug 26, 2023
@kszlim So there is a project doing this: https://github.com/Quantco/polarify/blob/87a0a3036effb29e779db319f11d1126671197d1/pixi.toml#L12
Which you could try out while waiting for us to work on this feature. We have started initial experiments with this issue.
kszlim commentedon Aug 26, 2023
Thanks, do you know how that works? I don't see what they're installing with pip, I've tried doing a
pixi shelland then pip installing stuff, but that doesn't seem to work.To me that looks like it's installing the current package as a pip dependency, but not dependencies that purely exist in pypi?
baszalmstra commentedon Aug 27, 2023
This is an issue caused by how we activate the environment when running
pixi shell#297. It produces this weird behavior when you use for instance homebrew or a conda base environment. This will be fixed soon.The workaround is indeed to use
pip installinside thepixi.toml(see https://github.com/hex-inc/vegafusion/blob/5e7ea041f7febe7c9ae96045291642818cffa9b4/pixi.toml#L29)kszlim commentedon Aug 27, 2023
Thanks, so from doing some digging what I understand is that you're going to be implementing the conda lock strategy? Does that mean conda lock solves dependencies together (from pip and conda)?
rahuldave commentedon Sep 6, 2023
unless one lockfile sees another (pixi lock sees poetry lock for example) I dont see any of these silutions as complete. Perhaps conda-lock is the only game in town for this (atleast for pip packages in the environment.yml) until pixi's combined resolution works. BTW i think once it works its gonna be a total gamechanger...
roaldarbol commentedon Oct 11, 2023
Have started to use pixi for most of the new projects I'm starting and it's awesome! This feature is highly anticipated, installing from PyPi is the only real hurdle I've had to face so far. Do you have any vague idea of when we could expect this? Even just short vs. long term, weeks or months? :-)
baszalmstra commentedon Oct 11, 2023
Thats great to hear! Im glad your enjoying it!
This is currently my primary focus. We are building on our recently opensourced library https://github.com/prefix-dev/rip . Rip already contains a number of important required components.
The initial implementation will not be fully featured but we’ll continue building from there. I dont want to make promises but I hope to land something relatively short term.
roaldarbol commentedon Oct 11, 2023
@baszalmstra That sounds great, it's all I needed to hear. Best of luck on the journey!
silverwind commentedon Oct 31, 2023
Shouldn't this issue be named "PyPI support"?
pipis just a CLI tool, so unless you are planning to re-implement this CLI, the issue is mislabeled 😉.[-]🐍 Install pip dependencies in pixi environment.[/-][+]🐍 Install pypi dependencies in pixi environment.[/+]feat: install pypi dependencies (alpha) (#452)
ruben-arts commentedon Jan 24, 2024
Hey followers, we have an initial implementation in. This issue was a source of some good ideas! But we've continued since with implementing it, so i'll close it.
Summary of the current status (at time of writing) :
We're missing:
pyproject.tomlWe're working hard on supporting more of these features while also building on the rest of pixi.
Most
PyPImagic happens inrip, checkout its issues to follow the work there.