Open dhirschfeld opened 4 months ago
Did you install using the binary?
Did you install using the binary?
Hatch or uv
? Both are installed with mamba
.
Have you tried this? https://hatch.pypa.io/latest/how-to/environment/select-installer/#externally-managed
I didn't know about that. Will give that a go, thanks!
Does that suffice?
Testing timeframes are likely measured in weeks - it's not causing any actual problems at present so isn't a super high priority...
When I install
hatch
, my globally installeduv
is masked by the version required byhatch
.
Is that within a hatch environment specifically? Or on the host? If it is on the host, it's probably due to mamba
in your PATH environment having higher precedence than your system uv
binary?
Otherwise, in a hatch shell you probably can access uv
from hatch, but not the hatch
command itself (documented here in collapsed section):
$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
$ cd /tmp && hatch shell --name 3.11
$ python --version
Python 3.12.3
# Fails due to modified PATH:
$ hatch --version
bash: /root/.local/share/pyapp/hatch/1303662642487178586/1.11.0/python/bin/hatch: cannot execute: required file not found
$ /usr/local/bin/hatch --version
Hatch, version 1.11.0
# UV is available however:
$ uv --version
uv 0.1.44
# hatch environment and hatch install location are given precedence for resolving binaries:
$ echo $PATH
/root/.local/share/hatch/env/virtual/opt/y8366zdl/opt/bin:/root/.local/share/pyapp/hatch/1303662642487178586/1.11.0/python/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
That happens with the curl
install (PyApp), but not with pipx
install. Presumably mamba
would be similar for you.
HATCH_ENV_TYPE_VIRTUAL_UV_PATH
IIRC only changes what uv
binary hatch will use implicitly. If your issue is not that, but with explicit use of the uv
command yourself, this ENV does not help AFAIK. The linked docs might not make that distinction clear though.
I use the
uv
package manager and have it globally installed as a default tool, available anywhere.When I install
hatch
, my globally installeduv
is masked by the version required byhatch
.It's not a big problem as
hatch
isn't constraininguv
, but it's worth considering if there's a way to not mask a globally installed version.