Checks
Reproducible example
mkdir -p /tmp/repro/a && cd /tmp/repro/a
cat > pixi.toml <<'TOML'
[workspace]
name = "relocate-repro"
channels = ["conda-forge"]
platforms = ["linux-64"]
[dependencies]
python = "3.12.*"
pip = "*"
TOML
pixi install
head -1 .pixi/envs/default/bin/pip
cat .pixi/envs/default/conda-meta/pixi_env_prefix; echo
mv /tmp/repro/a /tmp/repro/b && cd /tmp/repro/b
pixi -v install; echo "exit=$?"
head -1 .pixi/envs/default/bin/pip
cat .pixi/envs/default/conda-meta/pixi_env_prefix; echo
pixi run pip --version
Output:
The default environment has been installed.
#!/tmp/repro/a/.pixi/envs/default/bin/python3.12
/tmp/repro/a/.pixi/envs/default/conda-meta
INFO pixi_core::lock_file::update: the lock file is up-to-date
INFO pixi_core::lock_file::update: Installed environment 'default' in 3.643032ms
The default environment has been installed.
exit=0
#!/tmp/repro/a/.pixi/envs/default/bin/python3.12
/tmp/repro/b/.pixi/envs/default/conda-meta
Error launching 'pip': No such file or directory (os error 2)
Issue description
After the project directory moves, pixi install reports success and exits 0, but does not relink the environment. Every console-script shebang (and ipykernel's kernel.json) still points at the old prefix, so pixi run pip, jupyter, pytest and any notebook kernel fail with "bad interpreter" / "No such file or directory".
The part that turns this into a trap: pixi install rewrites conda-meta/pixi_env_prefix to the new location while doing nothing else. So the one piece of evidence that would let pixi (or a user) detect the relocation on the next run is destroyed on the first run. The binary does log "verifying prefix location is unchanged, with prefix file", so the check exists, but a mismatch neither triggers a reinstall nor produces a visible warning.
pixi run python keeps working, because PATH lookup execs the interpreter directly with no shebang involved. That makes the breakage easy to miss: we had an environment in a dev container whose mount point changed, and python worked for weeks while every entry point and kernel was broken. When we finally looked, pixi_env_prefix claimed the current path and 176 shebangs under bin/ disagreed.
pixi reinstall fixes the environment.
Expected behavior
When pixi_env_prefix does not match the environment's actual location, pixi install should relink the environment (what pixi reinstall does), or at minimum fail or warn loudly rather than silently updating the marker.
Environment
pixi 0.79.0, linux-64 (Ubuntu 24.04), packages from conda-forge.
Checks
conda-meta/pixi_env_prefixmarker.pixi --version(0.79.0).Reproducible example
Output:
Issue description
After the project directory moves,
pixi installreports success and exits 0, but does not relink the environment. Every console-script shebang (and ipykernel'skernel.json) still points at the old prefix, sopixi run pip,jupyter,pytestand any notebook kernel fail with "bad interpreter" / "No such file or directory".The part that turns this into a trap:
pixi installrewritesconda-meta/pixi_env_prefixto the new location while doing nothing else. So the one piece of evidence that would let pixi (or a user) detect the relocation on the next run is destroyed on the first run. The binary does log "verifying prefix location is unchanged, with prefix file", so the check exists, but a mismatch neither triggers a reinstall nor produces a visible warning.pixi run pythonkeeps working, because PATH lookup execs the interpreter directly with no shebang involved. That makes the breakage easy to miss: we had an environment in a dev container whose mount point changed, andpythonworked for weeks while every entry point and kernel was broken. When we finally looked,pixi_env_prefixclaimed the current path and 176 shebangs underbin/disagreed.pixi reinstallfixes the environment.Expected behavior
When
pixi_env_prefixdoes not match the environment's actual location,pixi installshould relink the environment (whatpixi reinstalldoes), or at minimum fail or warn loudly rather than silently updating the marker.Environment
pixi 0.79.0, linux-64 (Ubuntu 24.04), packages from conda-forge.