make virtualenv with specific python version(MACOS)
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
add a comment |
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
Do you meanusr/local/bin
in some local directory (your home directory, perhaps?) or the absolute directory/usr/local/bin
?
– tripleee
Jan 2 at 9:33
add a comment |
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
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
python macos tensorflow install
edited Jan 2 at 22:27


caffreyd
4221818
4221818
asked Jan 2 at 5:58


이태한이태한
31
31
Do you meanusr/local/bin
in some local directory (your home directory, perhaps?) or the absolute directory/usr/local/bin
?
– tripleee
Jan 2 at 9:33
add a comment |
Do you meanusr/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
add a comment |
2 Answers
2
active
oldest
votes
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
add a comment |
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.
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%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
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
add a comment |
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
add a comment |
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
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
answered Jan 2 at 9:31
tripleeetripleee
94.3k13133186
94.3k13133186
add a comment |
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
answered Jan 2 at 12:47


MPAMPA
78711329
78711329
add a comment |
add a comment |
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%2f54001880%2fmake-virtualenv-with-specific-python-versionmacos%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
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