How to change default python executable on Windows 10?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















I have an installation of python on my C drive, but since I have no admin rights I am unable to install modules into the same.




error: could not create 'C:Program FilesPython36Libsite-packagesyaml': Access is denied




I tried making a copy of the Python directory on the D folder and I changed the User environment variables to my path




D:Program FilesPython36



But when I use pythonin the command prompt the python exe file in the C drive is executed and not the one in the D drive.



This same issue is arising in Visual Studio Code. Only the Python interpreter in C drive can be selected, the copy in the D drive is not shown.



The system environment path points to the python directory in C drive and cannot be changed (due to lack of admin rights), but the user enviroment variables are set to the python directory in D drive.



How can I make the python exe file in D drive as my default interpreter?



The account environment variable and path is attached



environment variable



Path










share|improve this question































    0















    I have an installation of python on my C drive, but since I have no admin rights I am unable to install modules into the same.




    error: could not create 'C:Program FilesPython36Libsite-packagesyaml': Access is denied




    I tried making a copy of the Python directory on the D folder and I changed the User environment variables to my path




    D:Program FilesPython36



    But when I use pythonin the command prompt the python exe file in the C drive is executed and not the one in the D drive.



    This same issue is arising in Visual Studio Code. Only the Python interpreter in C drive can be selected, the copy in the D drive is not shown.



    The system environment path points to the python directory in C drive and cannot be changed (due to lack of admin rights), but the user enviroment variables are set to the python directory in D drive.



    How can I make the python exe file in D drive as my default interpreter?



    The account environment variable and path is attached



    environment variable



    Path










    share|improve this question



























      0












      0








      0








      I have an installation of python on my C drive, but since I have no admin rights I am unable to install modules into the same.




      error: could not create 'C:Program FilesPython36Libsite-packagesyaml': Access is denied




      I tried making a copy of the Python directory on the D folder and I changed the User environment variables to my path




      D:Program FilesPython36



      But when I use pythonin the command prompt the python exe file in the C drive is executed and not the one in the D drive.



      This same issue is arising in Visual Studio Code. Only the Python interpreter in C drive can be selected, the copy in the D drive is not shown.



      The system environment path points to the python directory in C drive and cannot be changed (due to lack of admin rights), but the user enviroment variables are set to the python directory in D drive.



      How can I make the python exe file in D drive as my default interpreter?



      The account environment variable and path is attached



      environment variable



      Path










      share|improve this question
















      I have an installation of python on my C drive, but since I have no admin rights I am unable to install modules into the same.




      error: could not create 'C:Program FilesPython36Libsite-packagesyaml': Access is denied




      I tried making a copy of the Python directory on the D folder and I changed the User environment variables to my path




      D:Program FilesPython36



      But when I use pythonin the command prompt the python exe file in the C drive is executed and not the one in the D drive.



      This same issue is arising in Visual Studio Code. Only the Python interpreter in C drive can be selected, the copy in the D drive is not shown.



      The system environment path points to the python directory in C drive and cannot be changed (due to lack of admin rights), but the user enviroment variables are set to the python directory in D drive.



      How can I make the python exe file in D drive as my default interpreter?



      The account environment variable and path is attached



      environment variable



      Path







      windows-10 command-line python3






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 30 at 4:34







      Adnan Arif Sait

















      asked Jan 29 at 8:07









      Adnan Arif SaitAdnan Arif Sait

      61




      61






















          1 Answer
          1






          active

          oldest

          votes


















          0














          This is most likely due to the path variable. You can see this in a command window by typing



          Path



          at your prompt.



          To update the settings,




          1. Open the 'System' properties.


          System Properties




          1. Open Environment Variables


          Path Variables




          1. Highlight the 'Path' Variable and click edit.


          Edit Path Variable




          1. Edit the values for the Python entries, to point to the desired python version.


          enter image description here




          1. OK on all boxes, close any CMD windows open, and open new one. Python command should now reference the correct location.




          Solution refers to Windows 10, but is essentially the same on Windows 7 +






          share|improve this answer



















          • 1





            I have made the changes in PATH for the user the path points to the desired python interpreter, but I cannot change the system variables. Still when I run python command the earlier (C drive) interpreter is used

            – Adnan Arif Sait
            Jan 29 at 8:49






          • 1





            Try a reboot if you haven't already... How are you launching the python file?

            – Stese
            Jan 29 at 9:05






          • 1





            I've tried rebooting, but to no gain. I run the python executable using "python" command and tried installing module using "python setup.py install"

            – Adnan Arif Sait
            Jan 29 at 11:03






          • 1





            Hmm, Can you screenshot the path variable?

            – Stese
            Jan 29 at 11:35






          • 1





            I have attached the screenshot of the path variable in the question

            – Adnan Arif Sait
            Jan 30 at 4:35














          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          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%2fsuperuser.com%2fquestions%2f1399544%2fhow-to-change-default-python-executable-on-windows-10%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









          0














          This is most likely due to the path variable. You can see this in a command window by typing



          Path



          at your prompt.



          To update the settings,




          1. Open the 'System' properties.


          System Properties




          1. Open Environment Variables


          Path Variables




          1. Highlight the 'Path' Variable and click edit.


          Edit Path Variable




          1. Edit the values for the Python entries, to point to the desired python version.


          enter image description here




          1. OK on all boxes, close any CMD windows open, and open new one. Python command should now reference the correct location.




          Solution refers to Windows 10, but is essentially the same on Windows 7 +






          share|improve this answer



















          • 1





            I have made the changes in PATH for the user the path points to the desired python interpreter, but I cannot change the system variables. Still when I run python command the earlier (C drive) interpreter is used

            – Adnan Arif Sait
            Jan 29 at 8:49






          • 1





            Try a reboot if you haven't already... How are you launching the python file?

            – Stese
            Jan 29 at 9:05






          • 1





            I've tried rebooting, but to no gain. I run the python executable using "python" command and tried installing module using "python setup.py install"

            – Adnan Arif Sait
            Jan 29 at 11:03






          • 1





            Hmm, Can you screenshot the path variable?

            – Stese
            Jan 29 at 11:35






          • 1





            I have attached the screenshot of the path variable in the question

            – Adnan Arif Sait
            Jan 30 at 4:35


















          0














          This is most likely due to the path variable. You can see this in a command window by typing



          Path



          at your prompt.



          To update the settings,




          1. Open the 'System' properties.


          System Properties




          1. Open Environment Variables


          Path Variables




          1. Highlight the 'Path' Variable and click edit.


          Edit Path Variable




          1. Edit the values for the Python entries, to point to the desired python version.


          enter image description here




          1. OK on all boxes, close any CMD windows open, and open new one. Python command should now reference the correct location.




          Solution refers to Windows 10, but is essentially the same on Windows 7 +






          share|improve this answer



















          • 1





            I have made the changes in PATH for the user the path points to the desired python interpreter, but I cannot change the system variables. Still when I run python command the earlier (C drive) interpreter is used

            – Adnan Arif Sait
            Jan 29 at 8:49






          • 1





            Try a reboot if you haven't already... How are you launching the python file?

            – Stese
            Jan 29 at 9:05






          • 1





            I've tried rebooting, but to no gain. I run the python executable using "python" command and tried installing module using "python setup.py install"

            – Adnan Arif Sait
            Jan 29 at 11:03






          • 1





            Hmm, Can you screenshot the path variable?

            – Stese
            Jan 29 at 11:35






          • 1





            I have attached the screenshot of the path variable in the question

            – Adnan Arif Sait
            Jan 30 at 4:35
















          0












          0








          0







          This is most likely due to the path variable. You can see this in a command window by typing



          Path



          at your prompt.



          To update the settings,




          1. Open the 'System' properties.


          System Properties




          1. Open Environment Variables


          Path Variables




          1. Highlight the 'Path' Variable and click edit.


          Edit Path Variable




          1. Edit the values for the Python entries, to point to the desired python version.


          enter image description here




          1. OK on all boxes, close any CMD windows open, and open new one. Python command should now reference the correct location.




          Solution refers to Windows 10, but is essentially the same on Windows 7 +






          share|improve this answer













          This is most likely due to the path variable. You can see this in a command window by typing



          Path



          at your prompt.



          To update the settings,




          1. Open the 'System' properties.


          System Properties




          1. Open Environment Variables


          Path Variables




          1. Highlight the 'Path' Variable and click edit.


          Edit Path Variable




          1. Edit the values for the Python entries, to point to the desired python version.


          enter image description here




          1. OK on all boxes, close any CMD windows open, and open new one. Python command should now reference the correct location.




          Solution refers to Windows 10, but is essentially the same on Windows 7 +







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 29 at 8:19









          SteseStese

          975414




          975414








          • 1





            I have made the changes in PATH for the user the path points to the desired python interpreter, but I cannot change the system variables. Still when I run python command the earlier (C drive) interpreter is used

            – Adnan Arif Sait
            Jan 29 at 8:49






          • 1





            Try a reboot if you haven't already... How are you launching the python file?

            – Stese
            Jan 29 at 9:05






          • 1





            I've tried rebooting, but to no gain. I run the python executable using "python" command and tried installing module using "python setup.py install"

            – Adnan Arif Sait
            Jan 29 at 11:03






          • 1





            Hmm, Can you screenshot the path variable?

            – Stese
            Jan 29 at 11:35






          • 1





            I have attached the screenshot of the path variable in the question

            – Adnan Arif Sait
            Jan 30 at 4:35
















          • 1





            I have made the changes in PATH for the user the path points to the desired python interpreter, but I cannot change the system variables. Still when I run python command the earlier (C drive) interpreter is used

            – Adnan Arif Sait
            Jan 29 at 8:49






          • 1





            Try a reboot if you haven't already... How are you launching the python file?

            – Stese
            Jan 29 at 9:05






          • 1





            I've tried rebooting, but to no gain. I run the python executable using "python" command and tried installing module using "python setup.py install"

            – Adnan Arif Sait
            Jan 29 at 11:03






          • 1





            Hmm, Can you screenshot the path variable?

            – Stese
            Jan 29 at 11:35






          • 1





            I have attached the screenshot of the path variable in the question

            – Adnan Arif Sait
            Jan 30 at 4:35










          1




          1





          I have made the changes in PATH for the user the path points to the desired python interpreter, but I cannot change the system variables. Still when I run python command the earlier (C drive) interpreter is used

          – Adnan Arif Sait
          Jan 29 at 8:49





          I have made the changes in PATH for the user the path points to the desired python interpreter, but I cannot change the system variables. Still when I run python command the earlier (C drive) interpreter is used

          – Adnan Arif Sait
          Jan 29 at 8:49




          1




          1





          Try a reboot if you haven't already... How are you launching the python file?

          – Stese
          Jan 29 at 9:05





          Try a reboot if you haven't already... How are you launching the python file?

          – Stese
          Jan 29 at 9:05




          1




          1





          I've tried rebooting, but to no gain. I run the python executable using "python" command and tried installing module using "python setup.py install"

          – Adnan Arif Sait
          Jan 29 at 11:03





          I've tried rebooting, but to no gain. I run the python executable using "python" command and tried installing module using "python setup.py install"

          – Adnan Arif Sait
          Jan 29 at 11:03




          1




          1





          Hmm, Can you screenshot the path variable?

          – Stese
          Jan 29 at 11:35





          Hmm, Can you screenshot the path variable?

          – Stese
          Jan 29 at 11:35




          1




          1





          I have attached the screenshot of the path variable in the question

          – Adnan Arif Sait
          Jan 30 at 4:35







          I have attached the screenshot of the path variable in the question

          – Adnan Arif Sait
          Jan 30 at 4:35




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Super User!


          • 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%2fsuperuser.com%2fquestions%2f1399544%2fhow-to-change-default-python-executable-on-windows-10%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

          "Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

          Alcedinidae

          RAC Tourist Trophy