Adding symlink to /usr/bin





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







1















I'm trying to add python3 to my path by adding a symlink but it's erroring and I'm not sure why.



/usr/bin $ sudo su
sh-3.2# ln -s /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 /usr/bin/python3
ln: /usr/bin/python3: Operation not permitted

sh-3.2# whoami
root

sh-3.2# ls -la | head -n 2
total 139064
drwxr-xr-x 977 root wheel 31264 24 Jul 2018 .


* Edit *



I have symlinked from /usr/local/bin/python3 so that's fine.










share|improve this question































    1















    I'm trying to add python3 to my path by adding a symlink but it's erroring and I'm not sure why.



    /usr/bin $ sudo su
    sh-3.2# ln -s /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 /usr/bin/python3
    ln: /usr/bin/python3: Operation not permitted

    sh-3.2# whoami
    root

    sh-3.2# ls -la | head -n 2
    total 139064
    drwxr-xr-x 977 root wheel 31264 24 Jul 2018 .


    * Edit *



    I have symlinked from /usr/local/bin/python3 so that's fine.










    share|improve this question



























      1












      1








      1








      I'm trying to add python3 to my path by adding a symlink but it's erroring and I'm not sure why.



      /usr/bin $ sudo su
      sh-3.2# ln -s /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 /usr/bin/python3
      ln: /usr/bin/python3: Operation not permitted

      sh-3.2# whoami
      root

      sh-3.2# ls -la | head -n 2
      total 139064
      drwxr-xr-x 977 root wheel 31264 24 Jul 2018 .


      * Edit *



      I have symlinked from /usr/local/bin/python3 so that's fine.










      share|improve this question
















      I'm trying to add python3 to my path by adding a symlink but it's erroring and I'm not sure why.



      /usr/bin $ sudo su
      sh-3.2# ln -s /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 /usr/bin/python3
      ln: /usr/bin/python3: Operation not permitted

      sh-3.2# whoami
      root

      sh-3.2# ls -la | head -n 2
      total 139064
      drwxr-xr-x 977 root wheel 31264 24 Jul 2018 .


      * Edit *



      I have symlinked from /usr/local/bin/python3 so that's fine.







      terminal symlink






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 3 hours ago







      AJP

















      asked 4 hours ago









      AJPAJP

      1007




      1007






















          1 Answer
          1






          active

          oldest

          votes


















          3














          /usr/bin is, as a lot of directories installed by default, protected by SIP and can't be modified by any user. There are ways to disable SIP, but the better approach is to use the directories beneath /usr/local for user-installed things



          sudo mkdir /usr/local/bin
          sudo ln -s /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 /usr/local/bin/
          sudo sh -c 'grep -q "/usr/local/bin" /etc/paths || echo "/usr/local/bin" >> /etc/paths'


          The last line will make sure that /usr/local/bin is part of PATH for all shells started/Terminal tabs created after the line has been executed.






          share|improve this answer
























          • Thank you. Is there a way to know what directories are protected by SIP from the command line? @nohillside

            – AJP
            3 hours ago








          • 1





            @AJP Sure, see support.apple.com/en-us/HT204899. Or use ls -Ol (that's the letter O)

            – nohillside
            3 hours ago



















          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          3














          /usr/bin is, as a lot of directories installed by default, protected by SIP and can't be modified by any user. There are ways to disable SIP, but the better approach is to use the directories beneath /usr/local for user-installed things



          sudo mkdir /usr/local/bin
          sudo ln -s /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 /usr/local/bin/
          sudo sh -c 'grep -q "/usr/local/bin" /etc/paths || echo "/usr/local/bin" >> /etc/paths'


          The last line will make sure that /usr/local/bin is part of PATH for all shells started/Terminal tabs created after the line has been executed.






          share|improve this answer
























          • Thank you. Is there a way to know what directories are protected by SIP from the command line? @nohillside

            – AJP
            3 hours ago








          • 1





            @AJP Sure, see support.apple.com/en-us/HT204899. Or use ls -Ol (that's the letter O)

            – nohillside
            3 hours ago
















          3














          /usr/bin is, as a lot of directories installed by default, protected by SIP and can't be modified by any user. There are ways to disable SIP, but the better approach is to use the directories beneath /usr/local for user-installed things



          sudo mkdir /usr/local/bin
          sudo ln -s /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 /usr/local/bin/
          sudo sh -c 'grep -q "/usr/local/bin" /etc/paths || echo "/usr/local/bin" >> /etc/paths'


          The last line will make sure that /usr/local/bin is part of PATH for all shells started/Terminal tabs created after the line has been executed.






          share|improve this answer
























          • Thank you. Is there a way to know what directories are protected by SIP from the command line? @nohillside

            – AJP
            3 hours ago








          • 1





            @AJP Sure, see support.apple.com/en-us/HT204899. Or use ls -Ol (that's the letter O)

            – nohillside
            3 hours ago














          3












          3








          3







          /usr/bin is, as a lot of directories installed by default, protected by SIP and can't be modified by any user. There are ways to disable SIP, but the better approach is to use the directories beneath /usr/local for user-installed things



          sudo mkdir /usr/local/bin
          sudo ln -s /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 /usr/local/bin/
          sudo sh -c 'grep -q "/usr/local/bin" /etc/paths || echo "/usr/local/bin" >> /etc/paths'


          The last line will make sure that /usr/local/bin is part of PATH for all shells started/Terminal tabs created after the line has been executed.






          share|improve this answer













          /usr/bin is, as a lot of directories installed by default, protected by SIP and can't be modified by any user. There are ways to disable SIP, but the better approach is to use the directories beneath /usr/local for user-installed things



          sudo mkdir /usr/local/bin
          sudo ln -s /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 /usr/local/bin/
          sudo sh -c 'grep -q "/usr/local/bin" /etc/paths || echo "/usr/local/bin" >> /etc/paths'


          The last line will make sure that /usr/local/bin is part of PATH for all shells started/Terminal tabs created after the line has been executed.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 4 hours ago









          nohillsidenohillside

          53.7k14112159




          53.7k14112159













          • Thank you. Is there a way to know what directories are protected by SIP from the command line? @nohillside

            – AJP
            3 hours ago








          • 1





            @AJP Sure, see support.apple.com/en-us/HT204899. Or use ls -Ol (that's the letter O)

            – nohillside
            3 hours ago



















          • Thank you. Is there a way to know what directories are protected by SIP from the command line? @nohillside

            – AJP
            3 hours ago








          • 1





            @AJP Sure, see support.apple.com/en-us/HT204899. Or use ls -Ol (that's the letter O)

            – nohillside
            3 hours ago

















          Thank you. Is there a way to know what directories are protected by SIP from the command line? @nohillside

          – AJP
          3 hours ago







          Thank you. Is there a way to know what directories are protected by SIP from the command line? @nohillside

          – AJP
          3 hours ago






          1




          1





          @AJP Sure, see support.apple.com/en-us/HT204899. Or use ls -Ol (that's the letter O)

          – nohillside
          3 hours ago





          @AJP Sure, see support.apple.com/en-us/HT204899. Or use ls -Ol (that's the letter O)

          – nohillside
          3 hours ago



          Popular posts from this blog

          GameSpot

          connect to host localhost port 22: Connection refused

          Getting a Wifi WPA2 wifi connection