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;








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 ?










share|improve this question



















  • 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

















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 ?










share|improve this question



















  • 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













0












0








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 ?










share|improve this question














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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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












  • 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












1 Answer
1






active

oldest

votes


















3















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 virtualenvs. 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:



  1. 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's pip package will have to be removed.

  2. (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.






share|improve this answer


























    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
    );



    );













    draft saved

    draft discarded


















    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









    3















    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 virtualenvs. 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:



    1. 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's pip package will have to be removed.

    2. (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.






    share|improve this answer































      3















      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 virtualenvs. 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:



      1. 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's pip package will have to be removed.

      2. (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.






      share|improve this answer





























        3














        3










        3









        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 virtualenvs. 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:



        1. 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's pip package will have to be removed.

        2. (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.






        share|improve this answer















        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 virtualenvs. 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:



        1. 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's pip package will have to be removed.

        2. (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.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Mar 27 at 23:50

























        answered Mar 27 at 23:37









        DepauDepau

        16413 bronze badges




        16413 bronze badges





















            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.



















            draft saved

            draft discarded
















































            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

            은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현