The python command starts the the wrong version of the python interpreter
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I am using Mac OS X Version 10.13.1 and I have just installed anaconda. I have created a virtual environment using the command
conda create -n py3 python=3
Then, I have started the python interpreter using the command
python
To my surprise, the preinstalled python 2.7 from /usr/bin showed up instead of python 3.6. In order to check what is going wrong I issued the command
which python
The result was even more surprising, I got the following:
/Users/karlstroetmann/anaconda2/envs/py3/bin/python
When I then invoked the command
/Users/karldrstroetmann/anaconda2/envs/py3/bin/python
I did get python 3.6.3. But I don't understand why I cannot invoke this version by just typping python
. What am I missing here? Any hints would be very much appreciated.
python anaconda
add a comment |Â
up vote
1
down vote
favorite
I am using Mac OS X Version 10.13.1 and I have just installed anaconda. I have created a virtual environment using the command
conda create -n py3 python=3
Then, I have started the python interpreter using the command
python
To my surprise, the preinstalled python 2.7 from /usr/bin showed up instead of python 3.6. In order to check what is going wrong I issued the command
which python
The result was even more surprising, I got the following:
/Users/karlstroetmann/anaconda2/envs/py3/bin/python
When I then invoked the command
/Users/karldrstroetmann/anaconda2/envs/py3/bin/python
I did get python 3.6.3. But I don't understand why I cannot invoke this version by just typping python
. What am I missing here? Any hints would be very much appreciated.
python anaconda
hash -t python
? Then tryhash -r
if it doesn't match & see.
â Michael Homer
Nov 12 '17 at 1:14
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I am using Mac OS X Version 10.13.1 and I have just installed anaconda. I have created a virtual environment using the command
conda create -n py3 python=3
Then, I have started the python interpreter using the command
python
To my surprise, the preinstalled python 2.7 from /usr/bin showed up instead of python 3.6. In order to check what is going wrong I issued the command
which python
The result was even more surprising, I got the following:
/Users/karlstroetmann/anaconda2/envs/py3/bin/python
When I then invoked the command
/Users/karldrstroetmann/anaconda2/envs/py3/bin/python
I did get python 3.6.3. But I don't understand why I cannot invoke this version by just typping python
. What am I missing here? Any hints would be very much appreciated.
python anaconda
I am using Mac OS X Version 10.13.1 and I have just installed anaconda. I have created a virtual environment using the command
conda create -n py3 python=3
Then, I have started the python interpreter using the command
python
To my surprise, the preinstalled python 2.7 from /usr/bin showed up instead of python 3.6. In order to check what is going wrong I issued the command
which python
The result was even more surprising, I got the following:
/Users/karlstroetmann/anaconda2/envs/py3/bin/python
When I then invoked the command
/Users/karldrstroetmann/anaconda2/envs/py3/bin/python
I did get python 3.6.3. But I don't understand why I cannot invoke this version by just typping python
. What am I missing here? Any hints would be very much appreciated.
python anaconda
asked Nov 12 '17 at 1:11
Carlos Ben Yussuf
82
82
hash -t python
? Then tryhash -r
if it doesn't match & see.
â Michael Homer
Nov 12 '17 at 1:14
add a comment |Â
hash -t python
? Then tryhash -r
if it doesn't match & see.
â Michael Homer
Nov 12 '17 at 1:14
hash -t python
? Then try hash -r
if it doesn't match & see.â Michael Homer
Nov 12 '17 at 1:14
hash -t python
? Then try hash -r
if it doesn't match & see.â Michael Homer
Nov 12 '17 at 1:14
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
0
down vote
accepted
It's very likely that the python
command has been hashed and that you need to clear the cache. In order to see what executable is actually being run you can use the type
command, e.g.:
type -a python
Unlike the which
command, the type
command is aware of hashed programs, as well as aliases and shell functions.
For further discussion of which (no pun intended) commands to use to determine which programs are executed by the shell, see the following post:
- Why not use "which"? What to use then?
Alternatively, you can also use the hash
command itself to determine if a given command has been hashed, e.g:
hash -t python
You can also list all hashed commands by running hash
without any arguments, i.e.:
hash
Similarly, you can use the alias
command to check if a given command is an alias, e.g.:
alias python
And you can list all active aliases as well:
alias
To clear the cached Python program you can use the following command:
hash -d python
Alternatively, you can clear everything all at once:
hash -r
To clear a single alias you could use the unalias
command, e.g.:
unalias python
Or you could clear all aliases at once:
unalias -a
add a comment |Â
up vote
0
down vote
I have solved my problem, it was a stupid mistake: I had an alias for python in my .bashrc. I had forgotten about this alias and hence the problem resulted.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
It's very likely that the python
command has been hashed and that you need to clear the cache. In order to see what executable is actually being run you can use the type
command, e.g.:
type -a python
Unlike the which
command, the type
command is aware of hashed programs, as well as aliases and shell functions.
For further discussion of which (no pun intended) commands to use to determine which programs are executed by the shell, see the following post:
- Why not use "which"? What to use then?
Alternatively, you can also use the hash
command itself to determine if a given command has been hashed, e.g:
hash -t python
You can also list all hashed commands by running hash
without any arguments, i.e.:
hash
Similarly, you can use the alias
command to check if a given command is an alias, e.g.:
alias python
And you can list all active aliases as well:
alias
To clear the cached Python program you can use the following command:
hash -d python
Alternatively, you can clear everything all at once:
hash -r
To clear a single alias you could use the unalias
command, e.g.:
unalias python
Or you could clear all aliases at once:
unalias -a
add a comment |Â
up vote
0
down vote
accepted
It's very likely that the python
command has been hashed and that you need to clear the cache. In order to see what executable is actually being run you can use the type
command, e.g.:
type -a python
Unlike the which
command, the type
command is aware of hashed programs, as well as aliases and shell functions.
For further discussion of which (no pun intended) commands to use to determine which programs are executed by the shell, see the following post:
- Why not use "which"? What to use then?
Alternatively, you can also use the hash
command itself to determine if a given command has been hashed, e.g:
hash -t python
You can also list all hashed commands by running hash
without any arguments, i.e.:
hash
Similarly, you can use the alias
command to check if a given command is an alias, e.g.:
alias python
And you can list all active aliases as well:
alias
To clear the cached Python program you can use the following command:
hash -d python
Alternatively, you can clear everything all at once:
hash -r
To clear a single alias you could use the unalias
command, e.g.:
unalias python
Or you could clear all aliases at once:
unalias -a
add a comment |Â
up vote
0
down vote
accepted
up vote
0
down vote
accepted
It's very likely that the python
command has been hashed and that you need to clear the cache. In order to see what executable is actually being run you can use the type
command, e.g.:
type -a python
Unlike the which
command, the type
command is aware of hashed programs, as well as aliases and shell functions.
For further discussion of which (no pun intended) commands to use to determine which programs are executed by the shell, see the following post:
- Why not use "which"? What to use then?
Alternatively, you can also use the hash
command itself to determine if a given command has been hashed, e.g:
hash -t python
You can also list all hashed commands by running hash
without any arguments, i.e.:
hash
Similarly, you can use the alias
command to check if a given command is an alias, e.g.:
alias python
And you can list all active aliases as well:
alias
To clear the cached Python program you can use the following command:
hash -d python
Alternatively, you can clear everything all at once:
hash -r
To clear a single alias you could use the unalias
command, e.g.:
unalias python
Or you could clear all aliases at once:
unalias -a
It's very likely that the python
command has been hashed and that you need to clear the cache. In order to see what executable is actually being run you can use the type
command, e.g.:
type -a python
Unlike the which
command, the type
command is aware of hashed programs, as well as aliases and shell functions.
For further discussion of which (no pun intended) commands to use to determine which programs are executed by the shell, see the following post:
- Why not use "which"? What to use then?
Alternatively, you can also use the hash
command itself to determine if a given command has been hashed, e.g:
hash -t python
You can also list all hashed commands by running hash
without any arguments, i.e.:
hash
Similarly, you can use the alias
command to check if a given command is an alias, e.g.:
alias python
And you can list all active aliases as well:
alias
To clear the cached Python program you can use the following command:
hash -d python
Alternatively, you can clear everything all at once:
hash -r
To clear a single alias you could use the unalias
command, e.g.:
unalias python
Or you could clear all aliases at once:
unalias -a
edited Nov 12 '17 at 14:41
answered Nov 12 '17 at 1:14
igal
4,830930
4,830930
add a comment |Â
add a comment |Â
up vote
0
down vote
I have solved my problem, it was a stupid mistake: I had an alias for python in my .bashrc. I had forgotten about this alias and hence the problem resulted.
add a comment |Â
up vote
0
down vote
I have solved my problem, it was a stupid mistake: I had an alias for python in my .bashrc. I had forgotten about this alias and hence the problem resulted.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
I have solved my problem, it was a stupid mistake: I had an alias for python in my .bashrc. I had forgotten about this alias and hence the problem resulted.
I have solved my problem, it was a stupid mistake: I had an alias for python in my .bashrc. I had forgotten about this alias and hence the problem resulted.
answered Nov 12 '17 at 13:48
Carlos Ben Yussuf
82
82
add a comment |Â
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f403972%2fthe-python-command-starts-the-the-wrong-version-of-the-python-interpreter%23new-answer', 'question_page');
);
Post as a guest
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
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
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
hash -t python
? Then tryhash -r
if it doesn't match & see.â Michael Homer
Nov 12 '17 at 1:14