Configure Pip to never install to global environment
up vote
2
down vote
favorite
I want to configure pip so that it will only ever install packages to virtual environments. I there a way to force it so that if ever I accidentally try to install a package to the 'global' environment that it will either deny me or force me through several prompts?
python pip virtualenv
|
show 2 more comments
up vote
2
down vote
favorite
I want to configure pip so that it will only ever install packages to virtual environments. I there a way to force it so that if ever I accidentally try to install a package to the 'global' environment that it will either deny me or force me through several prompts?
python pip virtualenv
Doesn't your OS do this by default (as long as you're not running asroot
)?
– Chris
Nov 9 at 20:42
@Chris no, by default pip will install to pre-configured system wide python path. No prompts for me.
– Rocky Li
Nov 9 at 20:44
Have you considered making the site-packages dir read-only? (I haven't, so I have no idea about the implications)
– jedwards
Nov 9 at 20:44
@RockyLi, what OS are you on? It's crazy that you don't need tosudo
(or whatever OS-specific alternative there is) to do that.
– Chris
Nov 9 at 20:46
@Chris mac. granted Ialias pip='pip3'
in mybashrc
and pip actually only install to local Cellar Python version that I installed withhomebrew
, this python is not system python but it's available from all.
– Rocky Li
Nov 9 at 20:48
|
show 2 more comments
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I want to configure pip so that it will only ever install packages to virtual environments. I there a way to force it so that if ever I accidentally try to install a package to the 'global' environment that it will either deny me or force me through several prompts?
python pip virtualenv
I want to configure pip so that it will only ever install packages to virtual environments. I there a way to force it so that if ever I accidentally try to install a package to the 'global' environment that it will either deny me or force me through several prompts?
python pip virtualenv
python pip virtualenv
asked Nov 9 at 20:39
TheJakester42
142
142
Doesn't your OS do this by default (as long as you're not running asroot
)?
– Chris
Nov 9 at 20:42
@Chris no, by default pip will install to pre-configured system wide python path. No prompts for me.
– Rocky Li
Nov 9 at 20:44
Have you considered making the site-packages dir read-only? (I haven't, so I have no idea about the implications)
– jedwards
Nov 9 at 20:44
@RockyLi, what OS are you on? It's crazy that you don't need tosudo
(or whatever OS-specific alternative there is) to do that.
– Chris
Nov 9 at 20:46
@Chris mac. granted Ialias pip='pip3'
in mybashrc
and pip actually only install to local Cellar Python version that I installed withhomebrew
, this python is not system python but it's available from all.
– Rocky Li
Nov 9 at 20:48
|
show 2 more comments
Doesn't your OS do this by default (as long as you're not running asroot
)?
– Chris
Nov 9 at 20:42
@Chris no, by default pip will install to pre-configured system wide python path. No prompts for me.
– Rocky Li
Nov 9 at 20:44
Have you considered making the site-packages dir read-only? (I haven't, so I have no idea about the implications)
– jedwards
Nov 9 at 20:44
@RockyLi, what OS are you on? It's crazy that you don't need tosudo
(or whatever OS-specific alternative there is) to do that.
– Chris
Nov 9 at 20:46
@Chris mac. granted Ialias pip='pip3'
in mybashrc
and pip actually only install to local Cellar Python version that I installed withhomebrew
, this python is not system python but it's available from all.
– Rocky Li
Nov 9 at 20:48
Doesn't your OS do this by default (as long as you're not running as
root
)?– Chris
Nov 9 at 20:42
Doesn't your OS do this by default (as long as you're not running as
root
)?– Chris
Nov 9 at 20:42
@Chris no, by default pip will install to pre-configured system wide python path. No prompts for me.
– Rocky Li
Nov 9 at 20:44
@Chris no, by default pip will install to pre-configured system wide python path. No prompts for me.
– Rocky Li
Nov 9 at 20:44
Have you considered making the site-packages dir read-only? (I haven't, so I have no idea about the implications)
– jedwards
Nov 9 at 20:44
Have you considered making the site-packages dir read-only? (I haven't, so I have no idea about the implications)
– jedwards
Nov 9 at 20:44
@RockyLi, what OS are you on? It's crazy that you don't need to
sudo
(or whatever OS-specific alternative there is) to do that.– Chris
Nov 9 at 20:46
@RockyLi, what OS are you on? It's crazy that you don't need to
sudo
(or whatever OS-specific alternative there is) to do that.– Chris
Nov 9 at 20:46
@Chris mac. granted I
alias pip='pip3'
in my bashrc
and pip actually only install to local Cellar Python version that I installed with homebrew
, this python is not system python but it's available from all.– Rocky Li
Nov 9 at 20:48
@Chris mac. granted I
alias pip='pip3'
in my bashrc
and pip actually only install to local Cellar Python version that I installed with homebrew
, this python is not system python but it's available from all.– Rocky Li
Nov 9 at 20:48
|
show 2 more comments
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53232966%2fconfigure-pip-to-never-install-to-global-environment%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Doesn't your OS do this by default (as long as you're not running as
root
)?– Chris
Nov 9 at 20:42
@Chris no, by default pip will install to pre-configured system wide python path. No prompts for me.
– Rocky Li
Nov 9 at 20:44
Have you considered making the site-packages dir read-only? (I haven't, so I have no idea about the implications)
– jedwards
Nov 9 at 20:44
@RockyLi, what OS are you on? It's crazy that you don't need to
sudo
(or whatever OS-specific alternative there is) to do that.– Chris
Nov 9 at 20:46
@Chris mac. granted I
alias pip='pip3'
in mybashrc
and pip actually only install to local Cellar Python version that I installed withhomebrew
, this python is not system python but it's available from all.– Rocky Li
Nov 9 at 20:48