I actually have three questions:
So I was trying to switch between python2.7 and python3.4. I added both the alternatives using
update-alternatives
, giving priorities 1 and 2, respectively. It was set to manual mode so I configured it and tried runningpython
. I don't know what happened here but it didn't work. It was working fine before setting the alternatives. But, instead, when I enteredpython2
it worked just fine and launched python2.7. Similarly, enteringpython3
launched python3.4. And this got me confused a bit.Isn't
python
supposed to be a generic command to run either v2.7 or v.3.4 based on the configuration?Now, very gallantly, I tried fixing this on my own, without feeling the need to look up what the problem was (naive, I know). I played around with it a bit. Removed the alternatives one-by-one using
remove
( should've usedremove-all
sighs ) but, suspiciously enough, when I ranupdate-alternatives --list python
, it still was showing the alternatives. Confusion++.What's the reason behind this? Why were those still being shown?
Anyway, assuming they were removed, I added the alternatives again and, in the hope of having fixed the problem, tried running
python
. Alas, it didn't work... displaying the following line:bash: /usr/lib/command-not-found: /usr/bin/python3: bad interpreter: No such file or directory
Next, tried running
python2
. Bam! This time, this one didn't work either! Producing a similar output:bash: /usr/lib/command-not-found: /usr/bin/python3: bad interpreter: No such file or directory
Same for
python3
. Output:bash: /usr/lib/command-not-found: /usr/bin/python3: bad interpreter: No such file or directory
So, what am I missing here and where lies the problem? Please elaborate.
PS : Pardon my ignorance. The questions might be silly but It's only recently that I started learning all this. I am pretty much a noob.
PPS : I am running Xubuntu 15.04.
TIA.
which
for the three commands?