uv: uv pip list / freeze / show --system do not show system packages on Fedora

Executing uv pip list --system does not list any packages. Similarly for freeze and show subcommands (I did not test any others).

$ uv pip list --system -vv
 uv_interpreter::find_python::find_default_python 
      0.000148s   0ms DEBUG uv_interpreter::find_python Starting interpreter discovery for default Python
      0.000319s   0ms DEBUG uv_interpreter::interpreter Cached interpreter info for Python 3.12.2, skipping probing: /usr/bin/python3
    0.000334s DEBUG uv::commands::pip_list Using Python 3.12.2 environment at /usr/bin/python3

OS: Fedora 39, python 3.12, amd64 uv version: 0.1.21, installed via pipx

About this issue

  • Original URL
  • State: open
  • Created 3 months ago
  • Comments: 21 (12 by maintainers)

Most upvoted comments

i can probably look into this sometime this week (maybe weekend) unless someone else is already on it :.)

Hmm, strange. I am running directly on Fedora 39, I am wondering if there are some differences between Fedora 39 Docker image and normal install. Also in your case you’re running under root, not sure if that makes a difference. I’ll try to dig around a bit more.

Indeed, installing something into system packages will install it to /usr/local/lib

$ sudo uv pip install tuna --system
Resolved 1 package in 261ms
Downloaded 1 package in 99ms
Installed 1 package in 3ms
 + tuna==0.5.11

$ uv pip list
Package Version
------- -------
tuna    0.5.11

$ uv pip show tuna
Name: tuna
Version: 0.5.11
Location: /usr/local/lib/python3.12/site-packages
Requires:

Here’s how the site directories are configured in my Python (Fedora 39)

$ python -c "import site;print(site.getsitepackages())"
['/usr/local/lib64/python3.12/site-packages', '/usr/local/lib/python3.12/site-packages', '/usr/lib64/python3.12/site-packages', '/usr/lib/python3.12/site-packages']

(To summarize, I think the fix here is to iterate over sys.paths (probably) instead of just looking at purelib and platlib.)

Yep, that seems to be the case.