-1

I am new to ubuntu and I wanted to shift my version to Python 3.4.1.

So I ran the command:

$ sudo update-alternatives --config python
update-alternatives: error: no alternatives for python

But then I try to run command:

$ sudo apt-get install python3.4
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python3.4 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 14 not upgraded.

I don't know how to switch between the versions. Please help.

sandhus
  • 101

2 Answers2

1

python 2.7 and python 3.4 is already preinstalled on your Ubuntu 14.04.

  • Run python3 command on terminal to get python3 interpreter.

  • Run python command on terminal to get python2 interpreter.

Avinash Raj
  • 80,446
1

Take at look at virtualenv and virtualenvwrapper. They'll allow you to set up an "environment" with one version of python. What's nice is you can pip install packages under that environment and then switch to another environment with a different set of packages installed - essentially running different versions of python without conflicts of libraries.

Ref: http://docs.python-guide.org/en/latest/dev/virtualenvs/

pcm
  • 386
  • 1
  • 2
  • 9