astral-sh / uv

An extremely fast Python package and project manager, written in Rust.
https://docs.astral.sh/uv
Apache License 2.0
23.53k stars 676 forks source link

Request: Add system-site-packages using uv add --script #7999

Open Eloitor opened 1 week ago

Eloitor commented 1 week ago

First I installed sage using the package manager of my linux distribution.

This works

main.py

from sage.all import ZZ
print(ZZ)
uv run main.py

Output is Integer Ring.

This does not work

uv add --script main.py datasheet
uv run main.py

I get:

Reading inline script metadata from: main.py
Traceback (most recent call last):
  File "/home/eloi/main.py", line 7, in <module>
    from sage.all import ZZ
ModuleNotFoundError: No module named 'sage'

Request

It would be nice if it was possible to add system-site-packages using uv add --script

Eloitor commented 1 week ago

related: https://github.com/astral-sh/uv/issues/1483