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
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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