uv
uv copied to clipboard
uv venv --system-site-packages support
I was wondering if uv venv could get support for the venv --system-site-packages option. We have virtual environments that use system installed packages for some of the more complex geospatial packages which we found causes less problems than pip installing those and I'd love to use uv venv if it also supported accessing/using system packages.
This seems reasonable to me
@owenlamont for a temporary fix, you can manually edit the pyvenv.cfg after creating the environment, e.g.:
$ uv venv uv-venv-test
Using Python 3.11.6 interpreter at /Users/samforeman/micromamba/envs/2023-11-11/bin/python3.11
Creating virtualenv at: uv-venv-test
Activate with: source uv-venv-test/bin/activate
Now, in the file: uv-venv-test/pyvenv.cfg change the following line:
~~include-system-site-packages = false~~
to
include-system-site-packages = true
Once complete, your pyvenv.cfg should look something like:
$ cat uv-venv-test/pyvenv.cfg
home = /Users/samforeman/micromamba/envs/2023-11-11/bin
implementation = CPython
version_info = 3.11
gourgeist = 0.0.4
include-system-site-packages = true
base-prefix = /Users/samforeman/micromamba/envs/2023-11-11
base-exec-prefix = /Users/samforeman/micromamba/envs/2023-11-11
base-executable = /Users/samforeman/micromamba/envs/2023-11-11/bin/python3.11