make virtualenv with specific python version(MACOS)












0















I installed brew, python3 (default and latest version) and pip3, pyenv.



TensorFlow does not support python3.7 now, so I heard that I should make a virtualenv that runs 3.6 or lower version independently.



I installed python 3.6.7 by pyenv install 3.6.7 but can't make virtualenv -p 3.6.7 (mydir) because 3.6.7 is not in the PATH (usr/local/bin).



How can I update my PATH?










share|improve this question

























  • Do you mean usr/local/bin in some local directory (your home directory, perhaps?) or the absolute directory /usr/local/bin?

    – tripleee
    Jan 2 at 9:33
















0















I installed brew, python3 (default and latest version) and pip3, pyenv.



TensorFlow does not support python3.7 now, so I heard that I should make a virtualenv that runs 3.6 or lower version independently.



I installed python 3.6.7 by pyenv install 3.6.7 but can't make virtualenv -p 3.6.7 (mydir) because 3.6.7 is not in the PATH (usr/local/bin).



How can I update my PATH?










share|improve this question

























  • Do you mean usr/local/bin in some local directory (your home directory, perhaps?) or the absolute directory /usr/local/bin?

    – tripleee
    Jan 2 at 9:33














0












0








0








I installed brew, python3 (default and latest version) and pip3, pyenv.



TensorFlow does not support python3.7 now, so I heard that I should make a virtualenv that runs 3.6 or lower version independently.



I installed python 3.6.7 by pyenv install 3.6.7 but can't make virtualenv -p 3.6.7 (mydir) because 3.6.7 is not in the PATH (usr/local/bin).



How can I update my PATH?










share|improve this question
















I installed brew, python3 (default and latest version) and pip3, pyenv.



TensorFlow does not support python3.7 now, so I heard that I should make a virtualenv that runs 3.6 or lower version independently.



I installed python 3.6.7 by pyenv install 3.6.7 but can't make virtualenv -p 3.6.7 (mydir) because 3.6.7 is not in the PATH (usr/local/bin).



How can I update my PATH?







python macos tensorflow install






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 2 at 22:27









caffreyd

4221818




4221818










asked Jan 2 at 5:58









이태한이태한

31




31













  • Do you mean usr/local/bin in some local directory (your home directory, perhaps?) or the absolute directory /usr/local/bin?

    – tripleee
    Jan 2 at 9:33



















  • Do you mean usr/local/bin in some local directory (your home directory, perhaps?) or the absolute directory /usr/local/bin?

    – tripleee
    Jan 2 at 9:33

















Do you mean usr/local/bin in some local directory (your home directory, perhaps?) or the absolute directory /usr/local/bin?

– tripleee
Jan 2 at 9:33





Do you mean usr/local/bin in some local directory (your home directory, perhaps?) or the absolute directory /usr/local/bin?

– tripleee
Jan 2 at 9:33












2 Answers
2






active

oldest

votes


















1














You don't need the executable to be on the PATH. Assuming you want /usr/local/bin/python3.6.7 to be used in the virtual environment,



virtualenv -p /usr/local/bin/python3.6.7 mydir


Updating your PATH is easy:



PATH=/usr/local/bin:$PATH


This will only update it in your current session; you might want to add this to your shell's startup files to make it permanent. This is a common FAQ but depends on a number of factors (your shell, etc) so google for details. Here is one question with several popular variants in the answers: Setting PATH environment variable in OSX permanently






share|improve this answer































    0














    I know that this doesn't answer the question exactly, but for completeness I'd like to add an Anaconda solution. Provided that an Anaconda environment is present on the system, a new Python environment can be created using conda create -n py36 python=3.6 pip. The name py36 can be arbitrarily chosen (could also be e.g. myenv or tensorflow), the desired Python version (in this example 3.6) is specified by python=3.6.



    This environment can then be activated using conda activate py36 (or whatever name you assigned in the previous step). Once the environment is active, you can install tensorflow via pip: pip install tensorflow-gpu. To deactivate the current environment and return to the default environment, use conda deactivate. In this way, you don't have to modify PATH variables.



    See also this documentation page for more details on the Anaconda environment.






    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%2f54001880%2fmake-virtualenv-with-specific-python-versionmacos%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      1














      You don't need the executable to be on the PATH. Assuming you want /usr/local/bin/python3.6.7 to be used in the virtual environment,



      virtualenv -p /usr/local/bin/python3.6.7 mydir


      Updating your PATH is easy:



      PATH=/usr/local/bin:$PATH


      This will only update it in your current session; you might want to add this to your shell's startup files to make it permanent. This is a common FAQ but depends on a number of factors (your shell, etc) so google for details. Here is one question with several popular variants in the answers: Setting PATH environment variable in OSX permanently






      share|improve this answer




























        1














        You don't need the executable to be on the PATH. Assuming you want /usr/local/bin/python3.6.7 to be used in the virtual environment,



        virtualenv -p /usr/local/bin/python3.6.7 mydir


        Updating your PATH is easy:



        PATH=/usr/local/bin:$PATH


        This will only update it in your current session; you might want to add this to your shell's startup files to make it permanent. This is a common FAQ but depends on a number of factors (your shell, etc) so google for details. Here is one question with several popular variants in the answers: Setting PATH environment variable in OSX permanently






        share|improve this answer


























          1












          1








          1







          You don't need the executable to be on the PATH. Assuming you want /usr/local/bin/python3.6.7 to be used in the virtual environment,



          virtualenv -p /usr/local/bin/python3.6.7 mydir


          Updating your PATH is easy:



          PATH=/usr/local/bin:$PATH


          This will only update it in your current session; you might want to add this to your shell's startup files to make it permanent. This is a common FAQ but depends on a number of factors (your shell, etc) so google for details. Here is one question with several popular variants in the answers: Setting PATH environment variable in OSX permanently






          share|improve this answer













          You don't need the executable to be on the PATH. Assuming you want /usr/local/bin/python3.6.7 to be used in the virtual environment,



          virtualenv -p /usr/local/bin/python3.6.7 mydir


          Updating your PATH is easy:



          PATH=/usr/local/bin:$PATH


          This will only update it in your current session; you might want to add this to your shell's startup files to make it permanent. This is a common FAQ but depends on a number of factors (your shell, etc) so google for details. Here is one question with several popular variants in the answers: Setting PATH environment variable in OSX permanently







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 2 at 9:31









          tripleeetripleee

          94.3k13133186




          94.3k13133186

























              0














              I know that this doesn't answer the question exactly, but for completeness I'd like to add an Anaconda solution. Provided that an Anaconda environment is present on the system, a new Python environment can be created using conda create -n py36 python=3.6 pip. The name py36 can be arbitrarily chosen (could also be e.g. myenv or tensorflow), the desired Python version (in this example 3.6) is specified by python=3.6.



              This environment can then be activated using conda activate py36 (or whatever name you assigned in the previous step). Once the environment is active, you can install tensorflow via pip: pip install tensorflow-gpu. To deactivate the current environment and return to the default environment, use conda deactivate. In this way, you don't have to modify PATH variables.



              See also this documentation page for more details on the Anaconda environment.






              share|improve this answer




























                0














                I know that this doesn't answer the question exactly, but for completeness I'd like to add an Anaconda solution. Provided that an Anaconda environment is present on the system, a new Python environment can be created using conda create -n py36 python=3.6 pip. The name py36 can be arbitrarily chosen (could also be e.g. myenv or tensorflow), the desired Python version (in this example 3.6) is specified by python=3.6.



                This environment can then be activated using conda activate py36 (or whatever name you assigned in the previous step). Once the environment is active, you can install tensorflow via pip: pip install tensorflow-gpu. To deactivate the current environment and return to the default environment, use conda deactivate. In this way, you don't have to modify PATH variables.



                See also this documentation page for more details on the Anaconda environment.






                share|improve this answer


























                  0












                  0








                  0







                  I know that this doesn't answer the question exactly, but for completeness I'd like to add an Anaconda solution. Provided that an Anaconda environment is present on the system, a new Python environment can be created using conda create -n py36 python=3.6 pip. The name py36 can be arbitrarily chosen (could also be e.g. myenv or tensorflow), the desired Python version (in this example 3.6) is specified by python=3.6.



                  This environment can then be activated using conda activate py36 (or whatever name you assigned in the previous step). Once the environment is active, you can install tensorflow via pip: pip install tensorflow-gpu. To deactivate the current environment and return to the default environment, use conda deactivate. In this way, you don't have to modify PATH variables.



                  See also this documentation page for more details on the Anaconda environment.






                  share|improve this answer













                  I know that this doesn't answer the question exactly, but for completeness I'd like to add an Anaconda solution. Provided that an Anaconda environment is present on the system, a new Python environment can be created using conda create -n py36 python=3.6 pip. The name py36 can be arbitrarily chosen (could also be e.g. myenv or tensorflow), the desired Python version (in this example 3.6) is specified by python=3.6.



                  This environment can then be activated using conda activate py36 (or whatever name you assigned in the previous step). Once the environment is active, you can install tensorflow via pip: pip install tensorflow-gpu. To deactivate the current environment and return to the default environment, use conda deactivate. In this way, you don't have to modify PATH variables.



                  See also this documentation page for more details on the Anaconda environment.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jan 2 at 12:47









                  MPAMPA

                  78711329




                  78711329






























                      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%2f54001880%2fmake-virtualenv-with-specific-python-versionmacos%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

                      MongoDB - Not Authorized To Execute Command

                      How to fix TextFormField cause rebuild widget in Flutter

                      in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith