-
Notifications
You must be signed in to change notification settings - Fork 892
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
--prefix
doesn't honor in-prefix Python
#9591
Comments
I also suspected #9373. Maybe related to #9371, but I sort of doubt it? Does it reproduce on 0.5.3? It seems reasonable to find and use the Python in the prefix by default. We should probably ignore it when |
I doubt we ever "discovered" this. I'm unsure on whether we should... |
The idea behind the two linked pull requests is that installing with |
Woah you all got to this way faster than I thought! Shouldn't have expected anything less. Love the work
Sure! And I totally understand there's multiple ways to go about this, but basically we have two bioinformatics The main application is installed into
Same error I mentioned about 0.5.4 - I tried a range of versions. It doesn't fail if I first activate DEBUG uv 0.5.3 (56d362208 2024-11-19)
DEBUG Searching for default Python interpreter in virtual environments
DEBUG Found `cpython-3.13.0-macos-aarch64-none` at `/opt/homebrew/bin/python` (search path)
DEBUG Ignoring Python interpreter at `/opt/homebrew/opt/python@3.13/bin/python3.13`: system interpreter not explicitly requested
DEBUG Found `cpython-3.13.0-macos-aarch64-none` at `/opt/homebrew/bin/python3` (search path)
DEBUG Ignoring Python interpreter at `/opt/homebrew/opt/python@3.13/bin/python3.13`: system interpreter not explicitly requested
DEBUG Found `cpython-3.11.10-macos-aarch64-none` at `/opt/homebrew/bin/python3.11` (search path)
DEBUG Ignoring Python interpreter at `/opt/homebrew/opt/python@3.11/bin/python3.11`: system interpreter not explicitly requested
DEBUG Found `cpython-3.12.7-macos-aarch64-none` at `/opt/homebrew/bin/python3.12` (search path)
DEBUG Ignoring Python interpreter at `/opt/homebrew/opt/python@3.12/bin/python3.12`: system interpreter not explicitly requested
DEBUG Found `cpython-3.13.0-macos-aarch64-none` at `/opt/homebrew/bin/python3.13` (search path)
DEBUG Ignoring Python interpreter at `/opt/homebrew/opt/python@3.13/bin/python3.13`: system interpreter not explicitly requested
DEBUG Found `cpython-3.9.6-macos-aarch64-none` at `/usr/bin/python3` (search path)
DEBUG Ignoring Python interpreter at `/Library/Developer/CommandLineTools/usr/bin/python3`: system interpreter not explicitly requested
error: No virtual environment found; run `uv venv` to create an environment, or pass `--system` to install into a non-virtual environment For comparison, this is 5.5's output:
|
Thanks for confirming the behavior! Have you considered |
I hadn't! It's a bit different than a standard tool install so it didn't occur to me; we have a lockfile UV_TOOL_DIR=<> uv tool install <tool> --with-requirements <lockfile> && \ which worked as expected, and I'll switch over to this. |
Sounds good! With the latest version, you can also provide your lockfile as We're also interested in allowing locks ( Could you share any more about the specifics of the tools (I have a bioinformatics background) you're installing and the lockfiles? I'd be curious to hear how it's different than a standard tool install. |
Hah - I just got the notification for 0.5.6 and saw the I wouldn't say it's too "different", more that I'm so far more used to using The one slight oddity is Aldy, which requires an installation of |
That makes sense. The long-term plan is to allow declarative tool installs, i.e., you'd define them in a TOML file and could install from there. I believe Pixi has a similar feature: https://prefix.dev/blog/pixi_global |
Going to close this as intentional behavior. |
@zanieb I didn't fully understand the previous statement, but why is this intentional? Doesn't this mean that installing an executable that imports packages is essentially unsupported with |
Yeah so returning to #9591 (comment) I don't think I closed this because we identified that it wasn't a regression and you had alternative workflows that make more sense. Happy to discuss still though.
Can you expand on this? I don't quite follow. |
Yeah, the alternative works for me and I find it way more idiomatic, so I'm not emotionally/personally
As in, with the <took a pause and did some reading; leaving the above so you know what I meant> Ah, I think I had my interpretation wrong and now the discussions make sense to me - I guess the This is the help entry for
Removing the "virtual environment" wording would be good - or maybe I just read too much into it? |
👍
Yeah, I guess I'm not sure if that's within the scope of the intent of
I think that's there to explain how the layout differs from
We certainly could adjust the wording though. Did
not give you pause? :) Perhaps we should expand that warning? |
I'm gonna be completely honest - when I checked the reference I didn't notice the second paragraph. Completely |
No problem! Thanks for taking the time to explain everything. |
Currently, when
--prefix
is provided,uv pip install
does not respect the in-prefix Python while installing binaries.In my opinion, in-prefix Python should be respected for two reasons: it feels more per expectations, and
currently,
uv
requires activating the virtual environment in such cases, which feels antithetical to uv's approach.I'm down to PR this, but wanted to see what kind of approach would be preferable. Would it be for init to
explicitly set
python
(unless provided) based on theprefix
?Version: Currently on
0.5.5
; I swear that when I was using0.5.4
it worked in the standard case but notwhen
VIRTUAL_ENV
was set to another path (in which case it still had the same behavior as below); but nowwhen I try 0.5.4, it errors out for not being able to find a virtual environment.
Potentially related to 0cd9c54; I can investigate more if this doesn't immediately ring any bells.
The text was updated successfully, but these errors were encountered: