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

Ensure that uv works with conda Python distributions #1062

Closed
charliermarsh opened this issue Jan 23, 2024 · 12 comments
Closed

Ensure that uv works with conda Python distributions #1062

charliermarsh opened this issue Jan 23, 2024 · 12 comments
Labels
compatibility Compatibility with a specification or another tool

Comments

@charliermarsh
Copy link
Member

This probably already works, but I've never tested it. It's worth testing manually.

@charliermarsh charliermarsh added the compatibility Compatibility with a specification or another tool label Jan 23, 2024
@zanieb
Copy link
Member

zanieb commented Jan 24, 2024

This isn't polished at all but I threw together some code to download distributions 07d247e

❯ python3.12 scripts/bootstrap install conda@3.11.2
2024-01-23 18:36:02 INFO Using version metadata from bootstrap/self/versions.json
2024-01-23 18:36:02 INFO Using system macos-aarch64
2024-01-23 18:36:02 INFO Searching for compatible Python version conda@3.11.2
2024-01-23 18:36:02 INFO Downloading conda@3.11.2
2024-01-23 18:36:03 INFO Verifying hash...
2024-01-23 18:36:06 INFO Installed to bootstrap/bin/python3.11.2
❯ bootstrap/bin/python3.11.2 --version
Python 3.11.2

@charliermarsh
Copy link
Member Author

That looks cool. I mostly want to make sure it works when installed through whatever their recommended method is though, so still worth testing I think?

@zanieb
Copy link
Member

zanieb commented Jan 24, 2024

I'm not sure you'll end up with different Python distributions by managing them directly from e.g. conda but yeah we should probably test it. I'm not sure if this is critical to do before release though.

@konstin konstin self-assigned this Feb 1, 2024
@charliermarsh
Copy link
Member Author

@konstin - Did you have a chance to look at this?

@konstin
Copy link
Member

konstin commented Feb 11, 2024

I didn't get to it unfortunately

@zanieb zanieb changed the title Ensure that Puffin works with conda Python distributions Ensure that uv works with conda Python distributions Feb 15, 2024
@drewbitt
Copy link

Works for me with miniforge installed through brew
Using Python 3.12.1 interpreter at /opt/homebrew/Caskroom/miniforge/base/bin/python3.12

@charliermarsh
Copy link
Member Author

You're awesome, thank you.

@shughes-uk
Copy link

shughes-uk commented Feb 15, 2024

This might be for a seperate ticket but we ran into this while testing out uv in conda environments.

uv pip install chardet                                                    (coiled)  ✘ 2
error: Failed to list installed packages
  Caused by: Found duplicate package in environment: wheel (/opt/homebrew/Caskroom/mambaforge/base/envs/coiled/lib/python3.11/site-packages/wheel-0.42.0.dist-info vs. /opt/homebrew/Caskroom/mambaforge/base/envs/coiled/lib/python3.11/site-packages/wheel-0.40.0.dist-info)

Duplicate dist-info's are pretty common in our experience with conda. We have to do some shenanigans to figure out what the real installed "active" version is.

@charliermarsh
Copy link
Member Author

That's interesting... We can probably support it, though would need to map out how various operations work. What does pip uninstall wheel do in that case?

@shughes-uk
Copy link

shughes-uk commented Feb 15, 2024

It seems to just remove the dist-info of whatever version pip installed.

Generally this seems to happens when you install a package via pip/conda and then install it again with the other package manager, files don't get cleaned up properly.

It's not super recommended to mix pip/conda, but every conda user i've met will do this pretty often.

@ntessore
Copy link

ntessore commented Feb 15, 2024

Not sure if I'm ignorant about a fundamental difference between build isolation in pip and uv pip, but simply trying out uv pip install . on a local project fails where pip install . succeeds. That happens in a conda environment where all dependencies are installed, but uv pip tries to download and build a package that cannot be compiled on my machine (but is installed in the conda env).

Edit: It looks like uv will try and build a local package against a newer version of a dependency from pip than the one currently installed in the conda environment. Reproducer

@zanieb
Copy link
Member

zanieb commented Apr 1, 2024

@ntessore fwiw I think that should be resolved by #2596

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Compatibility with a specification or another tool
Projects
None yet
Development

No branches or pull requests

6 participants