Installing pip in /usr/bin instead of /usr/local/binHow can I get a list of locally installed Python modules?How to upgrade all Python packages with pip?Why use pip over easy_install?How do I install pip on Windows?Python and pip, list all versions of a package that's available?pip install mysql-python fails with EnvironmentError: mysql_config not foundInstalling specific package versions with pipHow to install packages using pip according to the requirements.txt file from a local directory?What is the easiest way to remove all packages installed by pip?How do I install pip on macOS or OS X?
How did medieval manors handle population growth? Was there room for more fields to be ploughed?
Understanding data transmission rates over copper wire
Where could I find a math pen pal?
Is "prohibition against," a double negative?
Properly unlinking hard links
Find the logic in first 2 statements to give the answer for the third statement
Necessity of tenure for lifetime academic research
Why do motor drives have multiple bus capacitors of small value capacitance instead of a single bus capacitor of large value?
How do I portray irrational anger in first person?
What should be done with the carbon when using magic to get oxygen from carbon dioxide?
Can authors email you PDFs of their textbook for free?
Which language is the closest lexically to Spanish?
How to differentiate between two people with the same name in a story?
What was Captain Marvel supposed to do once she reached her destination?
Create a list of snaking numbers under 50,000
Small RAM 4 KB on the early Apple II?
What are the in-game differences between WoW Classic and the original 2006 Version
Under GDPR, can I give permission once to allow everyone to store and process my data?
What is this "opened" cube called?
Ask one verbal question to figure out who is blind and who is mute among three persons
Which is the correct version of Mussorgsky's Pictures at an Exhibition?
How can I improve my formal definitions
Why do presidential pardons exist in a country having a clear separation of powers?
Resources to learn about firearms?
Installing pip in /usr/bin instead of /usr/local/bin
How can I get a list of locally installed Python modules?How to upgrade all Python packages with pip?Why use pip over easy_install?How do I install pip on Windows?Python and pip, list all versions of a package that's available?pip install mysql-python fails with EnvironmentError: mysql_config not foundInstalling specific package versions with pipHow to install packages using pip according to the requirements.txt file from a local directory?What is the easiest way to remove all packages installed by pip?How do I install pip on macOS or OS X?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
So I am trying to upgrade pip. Currently pip is present in /usr/bin but when I upgrade pip using: “pip install --upgrade pip”, it upgrades pip into /usr/local/bin and not /usr/bin. Is there anyway to keep the pip installation in /usr/bin and all the pip libraries in /usr/lib or /usr/lib64, etc ?
python pip upgrade
add a comment |
So I am trying to upgrade pip. Currently pip is present in /usr/bin but when I upgrade pip using: “pip install --upgrade pip”, it upgrades pip into /usr/local/bin and not /usr/bin. Is there anyway to keep the pip installation in /usr/bin and all the pip libraries in /usr/lib or /usr/lib64, etc ?
python pip upgrade
1
Don't fiddle with/usr/bin
and/usr/lib
— you're risking breaking your system Python. Just put/usr/local/bin
before/usr/bin
in your$PATH
.
– phd
Mar 28 at 16:21
Ok I am just playing with a docker container.
– Jason
Mar 28 at 21:06
add a comment |
So I am trying to upgrade pip. Currently pip is present in /usr/bin but when I upgrade pip using: “pip install --upgrade pip”, it upgrades pip into /usr/local/bin and not /usr/bin. Is there anyway to keep the pip installation in /usr/bin and all the pip libraries in /usr/lib or /usr/lib64, etc ?
python pip upgrade
So I am trying to upgrade pip. Currently pip is present in /usr/bin but when I upgrade pip using: “pip install --upgrade pip”, it upgrades pip into /usr/local/bin and not /usr/bin. Is there anyway to keep the pip installation in /usr/bin and all the pip libraries in /usr/lib or /usr/lib64, etc ?
python pip upgrade
python pip upgrade
asked Mar 27 at 23:12
JasonJason
7842 gold badges13 silver badges33 bronze badges
7842 gold badges13 silver badges33 bronze badges
1
Don't fiddle with/usr/bin
and/usr/lib
— you're risking breaking your system Python. Just put/usr/local/bin
before/usr/bin
in your$PATH
.
– phd
Mar 28 at 16:21
Ok I am just playing with a docker container.
– Jason
Mar 28 at 21:06
add a comment |
1
Don't fiddle with/usr/bin
and/usr/lib
— you're risking breaking your system Python. Just put/usr/local/bin
before/usr/bin
in your$PATH
.
– phd
Mar 28 at 16:21
Ok I am just playing with a docker container.
– Jason
Mar 28 at 21:06
1
1
Don't fiddle with
/usr/bin
and /usr/lib
— you're risking breaking your system Python. Just put /usr/local/bin
before /usr/bin
in your $PATH
.– phd
Mar 28 at 16:21
Don't fiddle with
/usr/bin
and /usr/lib
— you're risking breaking your system Python. Just put /usr/local/bin
before /usr/bin
in your $PATH
.– phd
Mar 28 at 16:21
Ok I am just playing with a docker container.
– Jason
Mar 28 at 21:06
Ok I am just playing with a docker container.
– Jason
Mar 28 at 21:06
add a comment |
1 Answer
1
active
oldest
votes
In general, running pip
as root is never a good idea. You're installing files to your root that are not tracked by your distribution's package manager.
This may not sound that bad, but in general it is, because you're cluttering your system with files that may clash with others and that you're likely going to have a hard time removing.
Pip is doing the right thing installing itself system-wide into /usr/local
. The general convention is that stuff outside of your own directory, of /etc
, /var
and local
system directories is tracked by the package manager.
The package manager will overwrite files outside of these directories without asking. local
counterparts of system directories are there to give you the opportunity to install stuff system-wide without it being messed with. However, most of the times, there are better ways of doing it.
For example, the best way with Python is using virtualenv
s. They give you an isolated environment that you can activate and install stuff into, including an up-to-date version of pip.
You also can run it as a user (without sudo), but you will have to add its bin
directory to your $PATH
.
It's best if you leave /usr/bin/pip
alone, otherwise bad things may happen.
To answer your question, if you really can't live without having it in /usr/bin
or a virtualenv, I'm sad to tell you there is no such documented option for pip. However you have two options:
- Remove your distro's pip package, then symlink
/usr/bin/pip
to/usr/local/bin/pip
. That will work but it will still be technically installed in/usr/local
. Also, any other program that depends on your distro'spip
package will have to be removed. - (very bad) Download pip's sources, then install it with
sudo python setup.py install --prefix=/usr
. This will place it in/usr/bin
, but you should feel really bad for having done it.
I really can't stress enough how bad this practice is, though.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
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%2f55387879%2finstalling-pip-in-usr-bin-instead-of-usr-local-bin%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
In general, running pip
as root is never a good idea. You're installing files to your root that are not tracked by your distribution's package manager.
This may not sound that bad, but in general it is, because you're cluttering your system with files that may clash with others and that you're likely going to have a hard time removing.
Pip is doing the right thing installing itself system-wide into /usr/local
. The general convention is that stuff outside of your own directory, of /etc
, /var
and local
system directories is tracked by the package manager.
The package manager will overwrite files outside of these directories without asking. local
counterparts of system directories are there to give you the opportunity to install stuff system-wide without it being messed with. However, most of the times, there are better ways of doing it.
For example, the best way with Python is using virtualenv
s. They give you an isolated environment that you can activate and install stuff into, including an up-to-date version of pip.
You also can run it as a user (without sudo), but you will have to add its bin
directory to your $PATH
.
It's best if you leave /usr/bin/pip
alone, otherwise bad things may happen.
To answer your question, if you really can't live without having it in /usr/bin
or a virtualenv, I'm sad to tell you there is no such documented option for pip. However you have two options:
- Remove your distro's pip package, then symlink
/usr/bin/pip
to/usr/local/bin/pip
. That will work but it will still be technically installed in/usr/local
. Also, any other program that depends on your distro'spip
package will have to be removed. - (very bad) Download pip's sources, then install it with
sudo python setup.py install --prefix=/usr
. This will place it in/usr/bin
, but you should feel really bad for having done it.
I really can't stress enough how bad this practice is, though.
add a comment |
In general, running pip
as root is never a good idea. You're installing files to your root that are not tracked by your distribution's package manager.
This may not sound that bad, but in general it is, because you're cluttering your system with files that may clash with others and that you're likely going to have a hard time removing.
Pip is doing the right thing installing itself system-wide into /usr/local
. The general convention is that stuff outside of your own directory, of /etc
, /var
and local
system directories is tracked by the package manager.
The package manager will overwrite files outside of these directories without asking. local
counterparts of system directories are there to give you the opportunity to install stuff system-wide without it being messed with. However, most of the times, there are better ways of doing it.
For example, the best way with Python is using virtualenv
s. They give you an isolated environment that you can activate and install stuff into, including an up-to-date version of pip.
You also can run it as a user (without sudo), but you will have to add its bin
directory to your $PATH
.
It's best if you leave /usr/bin/pip
alone, otherwise bad things may happen.
To answer your question, if you really can't live without having it in /usr/bin
or a virtualenv, I'm sad to tell you there is no such documented option for pip. However you have two options:
- Remove your distro's pip package, then symlink
/usr/bin/pip
to/usr/local/bin/pip
. That will work but it will still be technically installed in/usr/local
. Also, any other program that depends on your distro'spip
package will have to be removed. - (very bad) Download pip's sources, then install it with
sudo python setup.py install --prefix=/usr
. This will place it in/usr/bin
, but you should feel really bad for having done it.
I really can't stress enough how bad this practice is, though.
add a comment |
In general, running pip
as root is never a good idea. You're installing files to your root that are not tracked by your distribution's package manager.
This may not sound that bad, but in general it is, because you're cluttering your system with files that may clash with others and that you're likely going to have a hard time removing.
Pip is doing the right thing installing itself system-wide into /usr/local
. The general convention is that stuff outside of your own directory, of /etc
, /var
and local
system directories is tracked by the package manager.
The package manager will overwrite files outside of these directories without asking. local
counterparts of system directories are there to give you the opportunity to install stuff system-wide without it being messed with. However, most of the times, there are better ways of doing it.
For example, the best way with Python is using virtualenv
s. They give you an isolated environment that you can activate and install stuff into, including an up-to-date version of pip.
You also can run it as a user (without sudo), but you will have to add its bin
directory to your $PATH
.
It's best if you leave /usr/bin/pip
alone, otherwise bad things may happen.
To answer your question, if you really can't live without having it in /usr/bin
or a virtualenv, I'm sad to tell you there is no such documented option for pip. However you have two options:
- Remove your distro's pip package, then symlink
/usr/bin/pip
to/usr/local/bin/pip
. That will work but it will still be technically installed in/usr/local
. Also, any other program that depends on your distro'spip
package will have to be removed. - (very bad) Download pip's sources, then install it with
sudo python setup.py install --prefix=/usr
. This will place it in/usr/bin
, but you should feel really bad for having done it.
I really can't stress enough how bad this practice is, though.
In general, running pip
as root is never a good idea. You're installing files to your root that are not tracked by your distribution's package manager.
This may not sound that bad, but in general it is, because you're cluttering your system with files that may clash with others and that you're likely going to have a hard time removing.
Pip is doing the right thing installing itself system-wide into /usr/local
. The general convention is that stuff outside of your own directory, of /etc
, /var
and local
system directories is tracked by the package manager.
The package manager will overwrite files outside of these directories without asking. local
counterparts of system directories are there to give you the opportunity to install stuff system-wide without it being messed with. However, most of the times, there are better ways of doing it.
For example, the best way with Python is using virtualenv
s. They give you an isolated environment that you can activate and install stuff into, including an up-to-date version of pip.
You also can run it as a user (without sudo), but you will have to add its bin
directory to your $PATH
.
It's best if you leave /usr/bin/pip
alone, otherwise bad things may happen.
To answer your question, if you really can't live without having it in /usr/bin
or a virtualenv, I'm sad to tell you there is no such documented option for pip. However you have two options:
- Remove your distro's pip package, then symlink
/usr/bin/pip
to/usr/local/bin/pip
. That will work but it will still be technically installed in/usr/local
. Also, any other program that depends on your distro'spip
package will have to be removed. - (very bad) Download pip's sources, then install it with
sudo python setup.py install --prefix=/usr
. This will place it in/usr/bin
, but you should feel really bad for having done it.
I really can't stress enough how bad this practice is, though.
edited Mar 27 at 23:50
answered Mar 27 at 23:37
DepauDepau
16413 bronze badges
16413 bronze badges
add a comment |
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
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.
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%2f55387879%2finstalling-pip-in-usr-bin-instead-of-usr-local-bin%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
1
Don't fiddle with
/usr/bin
and/usr/lib
— you're risking breaking your system Python. Just put/usr/local/bin
before/usr/bin
in your$PATH
.– phd
Mar 28 at 16:21
Ok I am just playing with a docker container.
– Jason
Mar 28 at 21:06