-
Notifications
You must be signed in to change notification settings - Fork 178
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
pixi global: environment variables (CONDA_PREFIX,PATH,etc.) in installed scripts break certain packages #1382
Comments
Yeah I saw this as well. Not sure what's causing this, we should have a closer look! |
The cause is the exported |
I'm not sure about these things, but shouldn't Pinging @wolfv @ruben-arts who should know more about these things :) Edit: and @bollwyvl because he is a maintainer as well |
Yeah, @183amir you correctly identified the problem. I am unsure how we should fix this. We have some other problems with global install so I think over time we want to introduce more configuration to the "global" installs - and one of the config options could be about the CONDA_PREFIX. Hypothetically it might also be nice to have some shared configuration for all pixi users that covers some cases like this (either as annotations in the packages or as some external file). |
The initial stab at We can adopt something like the Arch pattern, where they have a noarch |
Is there any reason why symbolic links are not used to export global installed bins? And I tried using a symbolic link to |
No, uv doesn't need python to run. python is not a runtime dependency of uv. uv can modify any python installation by installing pypi packages in there. It doesn't matter if the python installation is the system's python, a conda environment, or a virtual environment. Because you may have several python installations like the system one and a conda env, uv has some heuristics to detect where your currently activated python env is. Then, when you run commands like For conda environments, uv detects them through the
uv will look at the Now the problem with installing uv with pixi is that pixi always suppresses this
so when I do:
the My sugesstion is not to add this line:
in the generated bash file when you see the user is installing
|
Yeah @183amir, I get what your are saying, and I agree that holds true for most use-cases. I'm just concerned about the use-case you want to use On the flip-side by keeping the |
If there is no global python interpreter installed, isn't it possible to install with pixi? like
I am not sure what you mean here. If the If you guys are ok with adding an exception for |
There might not be globally activated env. The flip-side I mean is more in regards to if that variable is set uv will always use that python, so if there is a python included next to the uv env, it will prefer that even when running from a pixi environment for example. So if you global inject python next to uv, which would require the
I don't think uv would find it. I believe this is the discovery function: https://github.com/astral-sh/uv/blob/e0ad649c7449b7f54c0053e409ac6e7bf18a6f68/crates/uv-toolchain/src/discovery.rs#L204C4-L204C40 |
I'm fine with this, maybe initially as an option to global install? Not sure what @wolfv thinks. |
This could also be in a activation script in hte Then we don't need to add any special rules into pixi. WDYT @183amir? Thanks btw! |
That would still not work because BTW, I have the same issue with |
when installing with pixi global install, the CONDA_PREFIX and PATH env variables are shadowed (see prefix-dev/pixi#1382) and this breaks binary discovery (e.g. python) when a job is submitted.
when installing with pixi global install, the CONDA_PREFIX and PATH env variables are shadowed (see prefix-dev/pixi#1382) and this breaks binary discovery (e.g. python) when a job is submitted.
I discussed this topic with @baszalmstra, and we identified that the main use case for setting What do you think @wolfv? |
The reason I proposed a symbolic link solution is that simply skipping activation scripts didn't fully address my issue. Another challenge I encountered was installing gridtk using For instance, when I run:
|
This is really useful @183amir, thanks! The |
@Hofer-Julian FYI that would not work in pixi shell, we rely on the PATH variable to find executables within the environment. But perhaps we can do something special for pixi global. |
Yes, that's what I had in mind |
The only other potential issue I can think of is that some installed binaries might become broken without a symlink, particularly those that rely on the current shell. This is because installed binaries typically run under |
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
fails with:
Issue description
I have installed
uv
withpixi
using the command:which installs uv in a conda environment in
~/.pixi/envs/uv
where the uv binary is installed in~/.pixi/envs/uv/bin/uv
and a bash script named~/.pixi/bin/uv
is created with the following content:but the exported
CONDA_PREFIX
variable breaksuv
since it is meant to work on currently activated conda environment.Expected behavior
I expect to be able to install and use uv with pixi global install. However due to the nature of uv and how pixi creates global installations, uv breaks. I am not sure this is a bug in uv or pixi but would be nice to be able to install uv with pixi.
Note that I am not trying to use uv to install packages in a pixi environment. I know that pixi integrates uv internally. I am trying to use uv to pip install some packages in a conda environment.
The text was updated successfully, but these errors were encountered: