-
Notifications
You must be signed in to change notification settings - Fork 669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide pip
-> uv pip
alias in virtual environments
#1331
Comments
Hi! That's kind of a fun idea! I'm a little hesitant to step on the You can seed |
pip
-> uv pip
alias in virtual environments
but this is what default
while uv does not do that - so now if I accidentally run "pip install something" it will be installed globally |
Yeah I that's fair — I think #1330 may address a small part of that concern but I like your idea too. |
(Pip maintainer here) I'd be strongly against this because |
+1 that the default behavior is quite confusing/unexpected: $ uv venv -p 3.11
Using Python 3.11.8 interpreter at /opt/Python3.11.8/bin/python3.11
Creating virtualenv at: .venv
$ uv pip freeze
# no output -- good, no packages have been installed to this venv
$ source .venv/bin/activate
$ pip freeze
# outputs all the packages installed on my system installation, even with venv active
annotated-types==0.6.0
ansible-base==2.10.8
...
$ which pip
/home/jgauthier/.local/bin/pip
# venv doesn't change what `pip` I'm using compared to what I was expecting, based on how
This ^ could be quite destructive if you're unlucky / not careful |
IMHO uv should be symlink into the virtualenv, and operate automatically in that virtualenv now, I'm stuck if you don't activate the venv (whould should be optional):
|
Maybe the correct approach is to not call the |
I recommend using |
There's also the zipapp distribution of pip which will get executed by the active Python environment. The reality here, though, is that pip is designed to be installed in every environment. That's a historical consequence of a number of things, and it's not ideal, but it's really hard to change. And there's never been any real incentive to do so, as there's never been any viable alternative to pip until now. Simply by being an alternative to pip, There's a discussion at https://discuss.python.org/t/pip-plans-to-introduce-an-alternative-zipapp-deployment-method/17431 which adds some context to all of this. |
There are some very fair concerns about this idea. I think we are unlikely to do it; solving this is going to require more discussion and consideration. |
Perhaps a solution would be a |
I’m not sure why there is any need to overwrite the pip command at all. In spite of the current name, |
maybe rename "uv pip" to "uv rip" :) |
All the good names are taken, aren't they? :-) |
Uh, |
I do not think we're going to do this. See instead: |
mabye when uv creates virtualenv it should also create "symlink" for pip to
uv pip
?The text was updated successfully, but these errors were encountered: