Skip to content

python3 -m uv venv fails because of empty subprocess environment #1623

@SnoopJ

Description

@SnoopJ

uv version: (0.1.4 @ fef1956)
Platform: Ubuntu 20.04
Python version: 3.9.16 provided by pyenv

Reproduction

$ python3 -m uv venv test_venv
  x Neither `python` nor `python3` are in `PATH`. Is Python installed?
$ type -a python3  # uv is factually incorrect, there are *multiple* entries on PATH
python3 is /home/snoopjedi/.pyenv/shims/python3
python3 is /usr/bin/python3
python3 is /bin/python3

The same result occurs if I take the pyenv shim out of the loop by pointing directly at the relevant interpreter. This invocation has no reason to depend on PATH as far as I can tell, the analogous venv behavior would use the invoking interpreter in both cases.

$ pyenv which python3
/home/snoopjedi/.pyenv/versions/3.9.16/bin/python3
$ $(pyenv which python3) -m uv venv test_venv
  x Neither `python` nor `python3` are in `PATH`. Is Python installed?

If I point directly at the uv entrypoint, this invocation succeeds:

$ $(pyenv which uv) venv test_venv
Using Python 3.9.16 interpreter at /home/snoopjedi/.pyenv/versions/3.9.16/bin/python3
Creating virtualenv at: test_venv

But it is inconvenient that the behavior between the two is not consistent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingvirtualenvRelated to virtual environments

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions