How to set anaconda as a default python?
I have just installed the Anaconda (for ipython notebook -- wanted to run some pandas programme). It is installed successfully but the problem here is whenever I type which python
, it is always using a default python as /usr/bin/python
It will be great if someone can tell me how to setup the anaconda python as a default python. I am noob here till now I have just installed the anaconda in the default path as following ~/anaconda3
.
Thanks in advance.
14.04 python3 paths anaconda
add a comment |
I have just installed the Anaconda (for ipython notebook -- wanted to run some pandas programme). It is installed successfully but the problem here is whenever I type which python
, it is always using a default python as /usr/bin/python
It will be great if someone can tell me how to setup the anaconda python as a default python. I am noob here till now I have just installed the anaconda in the default path as following ~/anaconda3
.
Thanks in advance.
14.04 python3 paths anaconda
add a comment |
I have just installed the Anaconda (for ipython notebook -- wanted to run some pandas programme). It is installed successfully but the problem here is whenever I type which python
, it is always using a default python as /usr/bin/python
It will be great if someone can tell me how to setup the anaconda python as a default python. I am noob here till now I have just installed the anaconda in the default path as following ~/anaconda3
.
Thanks in advance.
14.04 python3 paths anaconda
I have just installed the Anaconda (for ipython notebook -- wanted to run some pandas programme). It is installed successfully but the problem here is whenever I type which python
, it is always using a default python as /usr/bin/python
It will be great if someone can tell me how to setup the anaconda python as a default python. I am noob here till now I have just installed the anaconda in the default path as following ~/anaconda3
.
Thanks in advance.
14.04 python3 paths anaconda
14.04 python3 paths anaconda
edited Jun 20 '17 at 2:48
wjandrea
9,28942664
9,28942664
asked Feb 24 '17 at 20:09
yogesh Ratudiyogesh Ratudi
36113
36113
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
I have the same setup as you desire. In my case the anaconda installer
added an entry in my ~/.bashrc
file. I don't know why yours did not. So to get to do what you want, add this to your ~/.bashrc
file:
export PATH="/home/yash/anaconda3/bin:$PATH"
You need to refresh your env variables after this by opening a new terminal or using source ~/.bashrc
With this:
$ which python
/home/yash/anaconda3/bin/python
And python -v
returns: anaconda
To get back to the former default, I comment out the entry setting the pathbin the .bashrc
file and get these results:
$ which python
/usr/bin/python
$ python -v
python 2.7.*
2
That's fine, ofc. But I'd suggest using environments, that way you can create as many python envs as you want and switch between them usingsource activate/deactivate
: conda.io/docs/using/envs.html
– Samuel Santana
Feb 24 '17 at 21:17
I have the above added to ~/.bashrc however which python does not return the anaconda3 version..... do I need to reboot for it to take effect? Just installed anaconda.
– user391339
Feb 23 '18 at 19:37
# added by Anaconda3 installer export PATH="/home/d/anaconda3/bin:$PATH"
– user391339
Feb 23 '18 at 19:38
1
Ah, I got it. You need to refresh the environment variables either by re-opening a new terminal or typing source ~/.bashrc
– user391339
Feb 23 '18 at 19:40
1
thanks! this answer saved my day!
– Jinhua Wang
yesterday
add a comment |
Instead of adding the entry in ~/.bashrc add the entry in ~/.profile or ~/.bash_profile as it is a path and not an alias. Also, adding the path in bashrc may slower the terminal unnecessarily. To know the detailed meaning of ~/.bashrc and it's difference with the profile visit this link.
add a comment |
After you installed Anaconda, just run
source ~/.bashrc
If you open the .bashrc
file you can see it added Anaconda python to environment variable.
New contributor
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
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%2faskubuntu.com%2fquestions%2f886983%2fhow-to-set-anaconda-as-a-default-python%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
I have the same setup as you desire. In my case the anaconda installer
added an entry in my ~/.bashrc
file. I don't know why yours did not. So to get to do what you want, add this to your ~/.bashrc
file:
export PATH="/home/yash/anaconda3/bin:$PATH"
You need to refresh your env variables after this by opening a new terminal or using source ~/.bashrc
With this:
$ which python
/home/yash/anaconda3/bin/python
And python -v
returns: anaconda
To get back to the former default, I comment out the entry setting the pathbin the .bashrc
file and get these results:
$ which python
/usr/bin/python
$ python -v
python 2.7.*
2
That's fine, ofc. But I'd suggest using environments, that way you can create as many python envs as you want and switch between them usingsource activate/deactivate
: conda.io/docs/using/envs.html
– Samuel Santana
Feb 24 '17 at 21:17
I have the above added to ~/.bashrc however which python does not return the anaconda3 version..... do I need to reboot for it to take effect? Just installed anaconda.
– user391339
Feb 23 '18 at 19:37
# added by Anaconda3 installer export PATH="/home/d/anaconda3/bin:$PATH"
– user391339
Feb 23 '18 at 19:38
1
Ah, I got it. You need to refresh the environment variables either by re-opening a new terminal or typing source ~/.bashrc
– user391339
Feb 23 '18 at 19:40
1
thanks! this answer saved my day!
– Jinhua Wang
yesterday
add a comment |
I have the same setup as you desire. In my case the anaconda installer
added an entry in my ~/.bashrc
file. I don't know why yours did not. So to get to do what you want, add this to your ~/.bashrc
file:
export PATH="/home/yash/anaconda3/bin:$PATH"
You need to refresh your env variables after this by opening a new terminal or using source ~/.bashrc
With this:
$ which python
/home/yash/anaconda3/bin/python
And python -v
returns: anaconda
To get back to the former default, I comment out the entry setting the pathbin the .bashrc
file and get these results:
$ which python
/usr/bin/python
$ python -v
python 2.7.*
2
That's fine, ofc. But I'd suggest using environments, that way you can create as many python envs as you want and switch between them usingsource activate/deactivate
: conda.io/docs/using/envs.html
– Samuel Santana
Feb 24 '17 at 21:17
I have the above added to ~/.bashrc however which python does not return the anaconda3 version..... do I need to reboot for it to take effect? Just installed anaconda.
– user391339
Feb 23 '18 at 19:37
# added by Anaconda3 installer export PATH="/home/d/anaconda3/bin:$PATH"
– user391339
Feb 23 '18 at 19:38
1
Ah, I got it. You need to refresh the environment variables either by re-opening a new terminal or typing source ~/.bashrc
– user391339
Feb 23 '18 at 19:40
1
thanks! this answer saved my day!
– Jinhua Wang
yesterday
add a comment |
I have the same setup as you desire. In my case the anaconda installer
added an entry in my ~/.bashrc
file. I don't know why yours did not. So to get to do what you want, add this to your ~/.bashrc
file:
export PATH="/home/yash/anaconda3/bin:$PATH"
You need to refresh your env variables after this by opening a new terminal or using source ~/.bashrc
With this:
$ which python
/home/yash/anaconda3/bin/python
And python -v
returns: anaconda
To get back to the former default, I comment out the entry setting the pathbin the .bashrc
file and get these results:
$ which python
/usr/bin/python
$ python -v
python 2.7.*
I have the same setup as you desire. In my case the anaconda installer
added an entry in my ~/.bashrc
file. I don't know why yours did not. So to get to do what you want, add this to your ~/.bashrc
file:
export PATH="/home/yash/anaconda3/bin:$PATH"
You need to refresh your env variables after this by opening a new terminal or using source ~/.bashrc
With this:
$ which python
/home/yash/anaconda3/bin/python
And python -v
returns: anaconda
To get back to the former default, I comment out the entry setting the pathbin the .bashrc
file and get these results:
$ which python
/usr/bin/python
$ python -v
python 2.7.*
edited Feb 23 '18 at 22:46
user391339
3712617
3712617
answered Feb 24 '17 at 20:58
George UdosenGeorge Udosen
21.2k94570
21.2k94570
2
That's fine, ofc. But I'd suggest using environments, that way you can create as many python envs as you want and switch between them usingsource activate/deactivate
: conda.io/docs/using/envs.html
– Samuel Santana
Feb 24 '17 at 21:17
I have the above added to ~/.bashrc however which python does not return the anaconda3 version..... do I need to reboot for it to take effect? Just installed anaconda.
– user391339
Feb 23 '18 at 19:37
# added by Anaconda3 installer export PATH="/home/d/anaconda3/bin:$PATH"
– user391339
Feb 23 '18 at 19:38
1
Ah, I got it. You need to refresh the environment variables either by re-opening a new terminal or typing source ~/.bashrc
– user391339
Feb 23 '18 at 19:40
1
thanks! this answer saved my day!
– Jinhua Wang
yesterday
add a comment |
2
That's fine, ofc. But I'd suggest using environments, that way you can create as many python envs as you want and switch between them usingsource activate/deactivate
: conda.io/docs/using/envs.html
– Samuel Santana
Feb 24 '17 at 21:17
I have the above added to ~/.bashrc however which python does not return the anaconda3 version..... do I need to reboot for it to take effect? Just installed anaconda.
– user391339
Feb 23 '18 at 19:37
# added by Anaconda3 installer export PATH="/home/d/anaconda3/bin:$PATH"
– user391339
Feb 23 '18 at 19:38
1
Ah, I got it. You need to refresh the environment variables either by re-opening a new terminal or typing source ~/.bashrc
– user391339
Feb 23 '18 at 19:40
1
thanks! this answer saved my day!
– Jinhua Wang
yesterday
2
2
That's fine, ofc. But I'd suggest using environments, that way you can create as many python envs as you want and switch between them using
source activate/deactivate
: conda.io/docs/using/envs.html– Samuel Santana
Feb 24 '17 at 21:17
That's fine, ofc. But I'd suggest using environments, that way you can create as many python envs as you want and switch between them using
source activate/deactivate
: conda.io/docs/using/envs.html– Samuel Santana
Feb 24 '17 at 21:17
I have the above added to ~/.bashrc however which python does not return the anaconda3 version..... do I need to reboot for it to take effect? Just installed anaconda.
– user391339
Feb 23 '18 at 19:37
I have the above added to ~/.bashrc however which python does not return the anaconda3 version..... do I need to reboot for it to take effect? Just installed anaconda.
– user391339
Feb 23 '18 at 19:37
# added by Anaconda3 installer export PATH="/home/d/anaconda3/bin:$PATH"
– user391339
Feb 23 '18 at 19:38
# added by Anaconda3 installer export PATH="/home/d/anaconda3/bin:$PATH"
– user391339
Feb 23 '18 at 19:38
1
1
Ah, I got it. You need to refresh the environment variables either by re-opening a new terminal or typing source ~/.bashrc
– user391339
Feb 23 '18 at 19:40
Ah, I got it. You need to refresh the environment variables either by re-opening a new terminal or typing source ~/.bashrc
– user391339
Feb 23 '18 at 19:40
1
1
thanks! this answer saved my day!
– Jinhua Wang
yesterday
thanks! this answer saved my day!
– Jinhua Wang
yesterday
add a comment |
Instead of adding the entry in ~/.bashrc add the entry in ~/.profile or ~/.bash_profile as it is a path and not an alias. Also, adding the path in bashrc may slower the terminal unnecessarily. To know the detailed meaning of ~/.bashrc and it's difference with the profile visit this link.
add a comment |
Instead of adding the entry in ~/.bashrc add the entry in ~/.profile or ~/.bash_profile as it is a path and not an alias. Also, adding the path in bashrc may slower the terminal unnecessarily. To know the detailed meaning of ~/.bashrc and it's difference with the profile visit this link.
add a comment |
Instead of adding the entry in ~/.bashrc add the entry in ~/.profile or ~/.bash_profile as it is a path and not an alias. Also, adding the path in bashrc may slower the terminal unnecessarily. To know the detailed meaning of ~/.bashrc and it's difference with the profile visit this link.
Instead of adding the entry in ~/.bashrc add the entry in ~/.profile or ~/.bash_profile as it is a path and not an alias. Also, adding the path in bashrc may slower the terminal unnecessarily. To know the detailed meaning of ~/.bashrc and it's difference with the profile visit this link.
answered Mar 5 '18 at 13:19
Paramjeet DesaiParamjeet Desai
211
211
add a comment |
add a comment |
After you installed Anaconda, just run
source ~/.bashrc
If you open the .bashrc
file you can see it added Anaconda python to environment variable.
New contributor
add a comment |
After you installed Anaconda, just run
source ~/.bashrc
If you open the .bashrc
file you can see it added Anaconda python to environment variable.
New contributor
add a comment |
After you installed Anaconda, just run
source ~/.bashrc
If you open the .bashrc
file you can see it added Anaconda python to environment variable.
New contributor
After you installed Anaconda, just run
source ~/.bashrc
If you open the .bashrc
file you can see it added Anaconda python to environment variable.
New contributor
New contributor
answered 7 hours ago
byronybyrony
101
101
New contributor
New contributor
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- 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%2faskubuntu.com%2fquestions%2f886983%2fhow-to-set-anaconda-as-a-default-python%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